Skip to main content
Interactive Algorithm Education

Visualize & Master Algorithms & Data Structures

Explore classic & modern sorting algorithms, efficient searching techniques, and interactive data structure visualizations — all with real-time step-by-step animation, comparisons, swaps, and Big-O metrics.

Search Visualizer

Linear Search

Speed 100ms
Size 15
Difficulty ★★★★★ Beginner
Best For Small or unsorted datasets
Step Progress 0 / 0
Comparisons 0
Target —
Status Ready
Playback Paused
Out of Range
Search Range
Probe / Mid
Found
Step Explanation

Select an algorithm, enter a target value, and click 'Search' to begin.

Pseudocode
 
When to Use

Select an algorithm to see recommended use cases.

History

Select an algorithm to see its history.

Searching Algorithms

Searching Algorithm Catalog

6 algorithms in this category. Click any card for detailed analysis.

Linear Search

Stable

Linear Search is the simplest search method. It scans each element of the array sequentially until the target value is found or the entire array has been traversed.

Ideal Use: Best suited for small or unsorted datasets where random access is limited, or when the target appears early in the array.
Best
O(1)
Worst
O(n)
Space
O(1)
Implementation Difficulty
★ ☆ ☆ ☆ ☆ 1/5
Beginner
Sorted Output Preview n=8
12
18
29
33
42
64
75
91

Jump Search

Stable

Jump Search is an improvement over Linear Search for sorted arrays. It jumps ahead by fixed-size blocks (√n) to find a range containing the target, then performs a linear scan within that block.

Ideal Use: Works well on sorted arrays when random access is cheap and the dataset is large enough to benefit from skipping elements.
Best
O(1)
Worst
O(√n)
Space
O(1)
Implementation Difficulty
★ ★ ☆ ☆ ☆ 2/5
Elementary
Sorted Output Preview n=8
12
18
29
33
42
64
75
91

Ternary Search

Stable

Ternary Search is a divide-and-conquer algorithm that splits the search interval into three equal parts and uses two midpoints to narrow down the target region. It is less efficient than Binary Search in practice despite the same asymptotic behavior.

Ideal Use: When searching unimodal functions or in contexts where dividing into three parts provides faster convergence (e.g., finding a peak in a unimodal array).
Best
O(1)
Worst
O(log₃ n)
Space
O(1)
Implementation Difficulty
★ ★ ☆ ☆ ☆ 2/5
Elementary
Sorted Output Preview n=8
12
18
29
33
42
64
75
91

Binary Search

Stable

Binary Search is an efficient algorithm for finding a target value in a sorted array by repeatedly dividing the search interval in half.

Ideal Use: When searching in large sorted arrays where O(log n) time complexity is needed and the data is already sorted or can be sorted once.
Best
O(1)
Worst
O(log n)
Space
O(1)
Implementation Difficulty
★ ★ ☆ ☆ ☆ 2/5
Elementary
Sorted Output Preview n=8
12
18
29
33
42
64
75
91

Exponential Search

Stable

Exponential Search starts from index 1 and exponentially increases the bound (1, 2, 4, 8, …) until the bound exceeds the target or the array ends. It then performs a binary search within the identified range.

Ideal Use: Ideal when the target is likely to be near the beginning of the array, or when the array size is unbounded or unknown.
Best
O(1)
Worst
O(log n)
Space
O(1)
Implementation Difficulty
★ ★ ★ ☆ ☆ 3/5
Intermediate
Sorted Output Preview n=8
12
18
29
33
42
64
75
91

Interpolation Search

Stable

Interpolation Search improves on Binary Search by using the probe position formula based on the value distribution, assuming uniformly distributed sorted data. It estimates where the target might be rather than always bisecting the midpoint.

Ideal Use: Best for large, uniformly distributed sorted arrays where O(log log n) average performance can be achieved.
Best
O(1)
Worst
O(n)
Space
O(1)
Implementation Difficulty
★ ★ ★ ☆ ☆ 3/5
Intermediate
Sorted Output Preview n=8
12
18
29
33
42
64
75
91
Searching Complexity Matrix

Complexity & Performance Tradeoffs

Side-by-side comparison of Big-O time and space complexity characteristics across searching algorithms.

Algorithm Best Time Average Time Worst Time Space Complexity Stability
Linear Search O(1) O(n) O(n) O(1) Stable
Jump Search O(1) O(√n) O(√n) O(1) Stable
Exponential Search O(1) O(log n) O(log n) O(1) Stable
Interpolation Search O(1) O(log log n) O(n) O(1) Stable
Ternary Search O(1) O(log₃ n) O(log₃ n) O(1) Stable
Binary Search O(1) O(log n) O(log n) O(1) Stable
⚡ Logarithmic Speed

Binary, Exponential, and Ternary Search achieve O(log n) time by repeatedly halving (or partitioning) the search range.

📐 Distribution Matters

Interpolation Search reaches O(log log n) average time on uniformly distributed data but degrades to O(n) worst-case.

💾 Minimal Memory

All search algorithms operate in-place using O(1) auxiliary space since they only track pointer indices — no extra data structures needed.