Playground
Every visualiser on the site. Each opens in its chapter, next to the explanation and the Java code it animates.Site ke saare visualisers. Har ek apne chapter mein khulta hai — explanation aur Java code ke bilkul saath.
1. Introduction
2. Time complexity
Will it run in time?Kya time limit mein chalega?
Slide n and watch each complexity class pass or fail a 1-second limit.n badlo aur dekho kaunsi complexity 1 second mein chalti hai.
§2.4Kadane’s algorithmKadane ka algorithm
Maximum subarray sum in one pass: extend or restart at every element.Ek pass mein maximum subarray sum: har element pe extend ya restart.
3. Sorting
Bubble, merge and counting sortBubble, merge aur counting sort
Swaps = inversions, halving and merging, and sorting without comparisons.Swaps = inversions, halving aur merging, aur bina compare kiye sorting.
§3.3Binary search, three waysBinary search, teen tareeke
Halving, jumping and lowerBound on the same sorted array.Ek hi sorted array pe halving, jumping aur lowerBound.
4. Data structures
5. Complete search
Generating subsets and permutationsSubsets aur permutations generate karna
The recursion tree, bitmasks, and the chosen[] search, step by step.Recursion tree, bitmasks, aur chosen[] wala search, step by step.
§5.3n queens backtracking
Place, check, backtrack: watch the board, the attacks and the solution count.Rakho, check karo, backtrack — board, attacks aur solutions dekho.
§5.4Pruning lab: grid paths
Run all five optimisation levels and compare the recursive calls.Paanchon optimisation levels chalao aur recursive calls compare karo.
§5.5Meet in the middle
Two halves, two sorted lists of sums, and a two-pointer search.Do halves, sums ki do sorted lists, aur two-pointer search.
9. Range queries
Prefix sum array
Build p in one pass, then answer sumq(a, b) with two lookups.Ek pass mein p banao, phir do lookups se sumq(a, b).
§9.12D prefix sums
Inclusion–exclusion on rectangles: S(A) − S(B) − S(C) + S(D).Rectangles pe inclusion–exclusion: S(A) − S(B) − S(C) + S(D).
§9.1Sparse table
Power-of-two blocks and the overlapping O(1) min query.Power-of-two blocks aur overlapping O(1) min query.
§9.2Fenwick tree
sum and add walking with k & −k, with the stored ranges drawn as bars.k & −k se sum aur add ka chalna, stored ranges bars mein.
§9.3Segment tree
Bottom-up build, range query, point update and argmin, for sum or min.Bottom-up build, range query, point update aur argmin — sum ya min.
§9.4Index compression
Sort, dedupe and map huge values to ranks 1, 2, 3, …Sort, dedupe aur badi values ko rank 1, 2, 3, … mein badlo.
§9.4Difference array
A whole range update with just two writes.Sirf do writes mein poori range ka update.
More visualisers arrive with each new chapter.Har naye chapter ke saath aur visualisers aayenge.