Searching Algorithms

Learn about different searching techniques and their implementations

Linear Search
Time Complexity: O(n) | Space Complexity: O(1)

A simple search algorithm that checks each element in a list sequentially until the desired element is found or the list ends.

Difficulty: Easy
Binary Search
Time Complexity: O(log n) | Space Complexity: O(1)

An efficient search algorithm that works on sorted arrays by repeatedly dividing the search interval in half.

Difficulty: Easy
Jump Search
Time Complexity: O(√n) | Space Complexity: O(1)

A search algorithm that works on sorted arrays by jumping ahead by fixed steps and then performing linear search.

Difficulty: Medium
Interpolation Search
Time Complexity: O(log log n) average, O(n) worst | Space Complexity: O(1)

An improved variant of binary search that works better for uniformly distributed data by estimating the position of the target value.

Difficulty: Medium