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

A complete guide to Big O notation

Use to describe the complexity(performance) of an Algorithm. Big O describes the worst case scenario. It can be used for both time and space complexity. O(1): Constant Time An algorithm is said to run in constant time if it requires the same amount of time regardless of the input size. Examples: Example 1:

Example […]

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