Hashing

Suppose we want to store contact detail(name, phone number). What type of data structure would you use? The first obvious choice will array. If you are using an array, then searching will be of O(n) complexity. Then you might say, let’s go for the binary search, then its complexity will be log(n). Yes, searching efficient […]

Continue reading

Binary Search Algorithm

Complexity: O(log(n)) Application: Use to find element in an Array. Algorithm:

  Code:

Download code

Continue reading

Linear Search Algorithm

Linear Search Algorithm complexity: O(n) Application: use to find element in an Array. Algorithm:

Code:

  Download code

Continue reading