AiTechWorlds
AiTechWorlds
Visualize Linear, Binary, Jump, Interpolation, and Exponential Search step-by-step with synced code and a live range pointer.
def binary_search(a, target):
lo, hi = 0, len(a) - 1
while lo <= hi:
mid = (lo + hi) // 2
if a[mid] == target: return mid
if a[mid] < target: lo = mid + 1
else: hi = mid - 1
return -1Binary Search repeatedly halves a sorted array by comparing the target with the middle element, discarding the half that cannot contain it.
| Best | O(1) |
| Average | O(log n) |
| Worst | O(log n) |
| Space | O(1) |
| Requires sorted | Yes |
The Searching Algorithm Visualizer on AiTechWorlds animates how search algorithms locate a target value in an array, one step at a time. Searching is a foundational topic in computer science and a frequent technical-interview subject, but the difference between linear, binary, jump, interpolation, and exponential search is far clearer when you watch the search pointer move and the active range shrink. This tool highlights the current index, the search range, and comparisons at each step, with synced code so you can map the animation to real implementation. Adjust array size and speed, or step through manually. Everything runs in your browser β AiTechWorlds built this for CS students, interview candidates, and educators.
Select an algorithm
Choose linear, binary, jump, interpolation, or exponential search.
Set the target
Pick the value to search for and adjust array size and speed.
Generate an array
Binary, jump, and interpolation search require a sorted array β the tool keeps it sorted automatically.
Run the search
Press Search to animate, or use Step mode to advance one comparison at a time.
Read the range pointer
Watch the active search range and comparison count update live.
100% Private β No Server Required
All processing happens directly in your browser. No data is uploaded, stored, or transmitted to any server.
Last reviewed on June 18, 2026 by the AiTechWorlds Tools Team. All processing runs locally in your browser.
Advertisement