DSA Quest
Learn DSA by playing it.
7 interactive games, 42 levels — from Big-O basics to trees and BFS. Clear 2 levels of a game to unlock the next one.
Beginner
1. Big-O Detective
0/18★Time complexity tells how work grows with input size n. Count loops: one loop = O(n), nested = O(n²), halving = O(log n).
2. Bubble Swap
Bubble sort swaps adjacent out-of-order pairs. Every swap fixes exactly one inversion, so minimum swaps = inversions.
3. Binary Hunt
In a sorted array, check the middle: if target is bigger, discard the left half; else the right. ⌈log₂(n+1)⌉ probes always suffice.
Intermediate
4. Two-Pointer Squeeze
On a sorted array, start L at the left, R at the right. Sum too small → L++, too big → R--. O(n) instead of O(n²).
5. Stack Shuffle
A stack is LIFO — Last In, First Out. Only the top element can be popped. Used in undo, recursion and bracket matching.
Advanced
6. Tree Walker
Binary tree traversals: Inorder (L, Node, R) gives sorted BST output; Preorder (Node, L, R); Postorder (L, R, Node); Level-order uses a queue (BFS).
7. BFS Maze Runner
Breadth-First Search explores layer by layer using a queue, so the first time it reaches a cell is via the shortest path in an unweighted grid.
