algorithm

https://www.geeksforgeeks.org/fundamentals-of-algorithms/

Search

  • Linear Search - O(n)
    • Recursive program to linearly search an element in a given array
    • Recursive function to do substring search
  • Binary Search - O(Logn)
    • Less comparison
    • Find number of occurrences of input k
    • Find minimum element in the sorted array which is rotated at an unknown position
    • Unbounded Binary Search Example (Find the point where a monotonically increasing function becomes positive first time)
  • Jump Search - O(√n)
  • Exponential Search - O(Logn)
  • Ternary Search - O((2 / Log23) * Log2n)
  • List Search - O(m*n)
  • Fibonacci Search - O(Logn)

Challenges

  • Find the missing number
  • Median of two sorted arrays
  • Two elements whose sum is closest to zero
  • Find the smallest and second smallest elements in an array
  • Middle of Three

Sort

Algorithms