← Back to Games

⚔️ The Duel of Searches

Watch Linear Knight and Binary Ninja compete to find the target!

🏟️ Search Arena
🗡️
LINEAR KNIGHT
O(N)
0
Steps
⚔️
VS
🥷
BINARY NINJA
O(log N)
0
Steps
🏆 WINNER!
0
Linear Steps
0
Binary Steps
0
Steps Saved
Sorted Array (N = 16) | Target: ?
Linear Search: Check each element from left to right
left: 0 mid: - right: 15
Binary Search: Jump to middle, eliminate half each time
⚙️ Battle Configuration
📜 Search Logs
🗡️ Linear Knight
🥷 Binary Ninja

📚 Why Binary Search is Faster

Binary Search works only on sorted arrays but is incredibly efficient because it eliminates half the search space with each comparison.

Array Size (N) Linear Search (N) Binary Search (log₂ N)
16 16 steps 4 steps
1,000 1,000 steps 10 steps
1,000,000 1,000,000 steps 20 steps
1 billion 1,000,000,000 steps 30 steps

Key insight: Linear search checks every element; Binary search halves the problem each step!