Searching Algorithms

SEARCHING | Sony Pictures Entertainment
Searching: The movie

Intend behind Searching Algorithms is to find, check for existence or retrieve some element in a given set of data. Till this point, I have solved many problems related to this topic and all of them could be solved with:

  1. Applied Mathematics
    • Find the missing and the repeating number from a given array of numbers from 1 to n.
  2. Binary Search
    • Median of two sorted arrays of the same/different size.
    • Count number of occurrences (or frequency) in a sorted array.
  3. Min/Max Heap
    •  Kth smallest element in a row-wise and column-wise sorted 2D array
  4. Pre-Sorting
    • This method is used to generate a sorted array on which a binary search is applied.
So my suggestion would be, whenever it says to find an element you should first think of the brute force method but the next step should be to think w.r.t. the above-mentioned algorithms and programming paradigm.

Practice problems:

Comments

Popular posts from this blog

The Mail

From Scatch to Top