Jump Search
Jumps through a sorted array in blocks of size √n to narrow the range fast, then runs a linear search inside the candidate block. The jump cost is higher than binary search, but it wins on storage where moving backward is expensive (magnetic tape, disk).
01Jump Search
Explore How It WorksStarting jump search. With ten values, hop three slots (√n) at a time to find the block that could hold the target 45.
Three slots in, the value is 23, still below 45. It isn't in this block, so hop three more.
The next landing is 56 — past the target. If 45 exists, it is in the block we just skipped over.
Scan that block from its start. The first value, 34, is not the target.
The next value is 45 — a match. End the search.
Search complete · 45 sits at index 4. Three hops plus two scanned values: five comparisons in all.
02 Understand It Simply
For EveryoneSteps ahead √n slots at a time to find the block that could hold the target, then scans that block from its start.
Jumps in √n-sized strides to find a candidate block quickly, then searches it linearly.
Good for media where backward seeks are costly.
- –Sorted data
- –sequential-access media (tape
- –disk)
03 Python Implementation
A clean, readable reference implementation of the core logic of Jump Search.
04 Frequently Asked Questions
FAQWhat is Jump Search?+
Jumps through a sorted array in blocks of size √n to narrow the range fast, then runs a linear search inside the candidate block. The jump cost is higher than binary search, but it wins on storage where moving backward is expensive (magnetic tape, disk).
What is the time complexity of Jump Search?+
The time complexity of Jump Search is O(√n). Follow the step-by-step visualization to see exactly why.
Where is Jump Search used?+
Sorted data, sequential-access media (tape, disk).
What's a simple analogy for Jump Search?+
Steps ahead √n slots at a time to find the block that could hold the target, then scans that block from its start.
