Skip to content

Latest commit

Β 

History

History
25 lines (17 loc) Β· 1.09 KB

File metadata and controls

25 lines (17 loc) Β· 1.09 KB

Searching Algorithms

Searching algorithms are designed to check whether a specific element exists within a data structure or to retrieve its position if it exists.

Searching Algorithms

Linear Search

Linear Search is a simple algorithm that checks every element in the list sequentially until it finds the target or reaches the end.

Time and Space Complexity

Algorithm Time Complexity Space Complexity
Linear Search O(n) O(1)

Binary Search

Binary Search is a more efficient algorithm than Linear Search. It works on sorted arrays and repeatedly divides the search interval in half.

Time and Space Complexity

Algorithm Time Complexity Space Complexity
Binary Search O(log n) O(1)