SAED stands for Synopsys Armenia Educational Department, the university where I received my bachelor's degree.
In this repository, I store my implemented algorithms, which I learned during SAED's algorithms course.
- Write a program that calculates the square root of a number using the Babylon method.
- Write a program to check if an integer is prime.
- Write a program to find the greatest common divisor (GCD) of two integers by prime factorization.
- Write a program to find the greatest common divisor (GCD) of two integers using the Euclidean algorithm.
- Write a program that will calculate the lowest common multiple (LCM) of two integers by factorization.
- Implement the "Insertion Sort" algorithm, which will sort n integers in increasing order.
- Write a program that adds two n-bit binary numbers, stored in two arrays of size n.
- Write a program that finds the maximum element in an array of size n. Analyze the running time.
- Implement the "Selection Sort" algorithm, which will sort n integers in increasing order.
- Implement the "Merge Sort" algorithm, which will sort n integers in increasing order.
- Implement a recursive version of "Insertion Sort".
- Implement a recursive version of "Binary Search".
- Implement a loop version of "Binary Search".
- Implement a hybrid sorting algorithm of Merge and Insertion sort so that in cases where the array size gets smaller than the given k positive number, it directly sorts with Insertion.
- Implement the "Bubble Sort" algorithm, which will sort n integers in increasing order.
- Swap two integers without a temporary.
- Given an array of integers, write a program to output its maximum subarray indices. Implement the brute-force version with O(n^2) complexity.
- Solve problem 17 with the O(n) complexity algorithm.
- Implement the "Min Heapify" algorithm.
- Implement an iterative version of the "Max Heapify" algorithm.
- Implement a bogomax() function that takes an array and returns the first element if it's the maximum; otherwise, it finds the maximum by repeatedly swapping the first element with a randomly selected one and re-checking.
- Write a function that will find the middle node value in a singly linked list.