Skip to main content

Searching

One-line summary: Locate a target within a collection โ€” from O(n) linear scans to O(log n) binary search on sorted data.


Algorithms in this sectionโ€‹

Runnable implementations (with tests) live alongside this guide in this folder:


Quick Comparisonโ€‹

AlgorithmTime (avg)Requires Sorted?
Linear SearchO(n)No
Binary SearchO(log n)Yes
Jump SearchO(โˆšn)Yes
Interpolation SearchO(log log n)Yes (uniform)

  • Sorting โ€” prerequisite for binary/jump/interpolation search
  • Binary Search โ€” problem-set applications of binary search

โ† Back to Home ยท ยฉ sparshjaswal