β Back to Games
πΊοΈ Castle Map - Divide to Conquer
βοΈ Mini-Bosses Guarding Each Division
βοΈ Controls
π Division Log
π° Welcome to the Divide & Conquer Castle!
π The Math Behind O(log N)
π Why O(log N) is So Powerful
Logarithmic complexity occurs when we can
eliminate half the problem with each step.
-
Binary Search: Eliminate half of remaining elements
each comparison
-
Binary Trees: Navigate by going left/right, halving
possibilities
-
Divide & Conquer: Split problem in half recursively
Incredible scaling: Even with 1 billion elements,
logβ(1,000,000,000) β 30 steps!
|
N
|
O(N) steps
|
O(log N) steps
|
| 1,000 |
1,000 |
10 |
| 1,000,000 |
1,000,000 |
20 |
| 1,000,000,000 |
1,000,000,000 |
30 |