These scrolls correspond to the twelve Gurukul episodes — but they’re
written to stand alone. Think of them as algorithm reference
pages anchored to very specific stories you’ve already seen:
markets, caverns, libraries, ancestral halls, burning bazaars, and
more.
Scroll I
Arrays & Linear Thinking
Walking the line, one step at a time.
How to reason about contiguous memory, indices, off-by-one traps,
prefix operations, and simple passes over data. This is the
walking pace of most algorithms.
Concepts: arrays, iteration patterns, prefix logic, boundaries.
Read the array scripture ↗
Scroll II
Two-Pointer Patterns
Guards at opposite gates.
When scanning from both ends beats brute force. Patterns for pair
sums, palindromes, partitioning, and shrinking ranges with two
moving indices.
Concepts: opposite pointers, convergence, partitioning, O(n) vs O(n²).
Read the two-pointers scripture ↗
Scroll III
Sliding Window
Managing limited attention over time.
Subarrays and subranges under constraints: fixed and variable
windows, counting vs optimizing, and how to move the window without
recomputing everything.
Concepts: windows, running counts, amortized O(n), time-boxed state.
Read the sliding window scripture ↗
Scroll IV
Greedy Algorithms & Scheduling
Local choice, global gain — when it works.
The rule “pick what finishes earliest” in a crowded schedule, and
why some problems love greedy rules while others punish them.
Concepts: greedy choice, interval scheduling, proofs of correctness, counterexamples.
Read the greedy scheduling scripture ↗
Scroll V
Sorting Basics
Everything is chaos until you impose order.
Selection vs insertion sort, stability, complexity, and why
“sorting first” is secretly the answer to an absurd number of
problems.
Concepts: O(n²) basics, comparison model, when pre-sorting unlocks simpler logic.
Read the sorting scripture ↗
Scroll VI
Hash Maps
The Hall of Thousand Doors.
Key → slot → value. Constant-time lookup in theory, what collisions
actually mean, and how hash maps simplify counting, grouping, and
memoization tasks.
Concepts: hashing, buckets, collisions, average O(1), typical pitfalls.
Read the hash map scripture ↗
Scroll VII
Binary Search
Jump to the middle first.
More than “guess the number”: searching on value space, lower/upper
bounds, and how to reason about invariants while halving the
search region.
Concepts: sorted domains, invariants, bounds, log n steps.
Read the binary search scripture ↗
Scroll VIII
Recursion & the Call Stack
When the problem calls a smaller copy of itself.
Base cases, shrinking steps, and how to picture the call stack as a
vertical cavern of echoes instead of black magic that “just
works”.
Concepts: base case, recurrence, stack frames, stack overflow.
Read the recursion scripture ↗
Scroll IX
Trees & Traversals
Roots, branches, and visiting order.
Binary trees as royal lineages: parents, children, depth, and the
difference between preorder, inorder, and postorder passes.
Concepts: tree shapes, traversal orders, recursion patterns on trees.
Read the trees scripture ↗
Scroll X
Priority Queues & Heaps
What truly matters first.
The Burning Bazaar formalized: heap structure, push / pop
operations, and why “always handle the most important thing
next” is a powerful abstraction.
Concepts: heap shape, heap property, insert / extract, typical uses.
Read the heap scripture ↗
Scroll XI
Backtracking
Exploring and undoing, without shame.
Systematic trial and error: decision trees, marking choices,
undoing state, and pruning branches that can’t possibly lead to a
valid solution.
Concepts: search trees, state restore, pruning, exponential spaces.
Read the backtracking scripture ↗
Scroll XII
Divide & Conquer
Splitting mountains into climbable pieces.
How to split a big problem into independent subproblems, solve them
recursively, and merge the answers — from merge sort to more
creative decompositions.
Concepts: problem decomposition, merge step, recursion trees, T(n) recurrences.
Read the divide & conquer scripture ↗