← Back to Hub

🏔️ The Ordered Mountain Gate

Classic Binary Search Adventure

Target Treasure

-

Current Mid

-

Search Range

-

Steps Taken

0
mid = (l + r) / 2 = ?
Click "Start Search" to begin your quest!
⛰️ The Sorted Mountain Path ⛰️
Left (L): -
Mid (M): -
Right (R): -
Generate an array and start your binary search adventure!

📖 Binary Search Algorithm

Time Complexity: O(log n) — Each step halves the search space!

Space Complexity: O(1) — Only uses a few pointers.

Requirement: Array must be SORTED

How it works: Compare the target with the middle element. If target is smaller, search the left half. If larger, search the right half. Repeat until found!

🏆
TREASURE FOUND!
0
Steps Taken
0
Max Possible (log₂n)

Binary Search found the treasure in O(log n) time!