Dinesh/ Blog

Latest articles

Notes on software, mathematics, and machine learning.

All articles
  1. Calculus II — Gradients & Gradient Descent from Scratch

    Derive gradients and quadratic step-size bounds, compare batch and stochastic updates, and test convergence and numerical assumptions.

  2. Probability — Random Variables, Distributions, Expectation

    Uncertainty, quantified: random variables, the distributions you'll actually meet (Bernoulli, binomial, normal, exponential, Poisson), expectation, variance, and Bayes' rule.

  3. Arrays & Strings — Indexing, Slicing, Two-Pointer

    Apply indexing, slicing, compaction and two-pointer methods with explicit ordering, mutation, Unicode and complexity contracts.

  4. Hashmaps & Sets — Hash Functions, Collisions

    Derive hash-table lookup and collision behavior, stable hash/equality contracts, ordering limits and explicit expected versus worst-case costs.

  5. Stacks & Queues — LIFO/FIFO in Practice

    Apply LIFO and FIFO invariants to traversal, monotonic structures and bounded queues; distinguish local ordering from distributed guarantees.

  6. Recursion — Call Stack, Base Case, Worked Examples

    Trace recursive calls and base cases, account for memo and stack resources, and compare equivalent iterative implementations.

  7. Trees & BSTs — Traversal (BFS/DFS)

    Trace tree traversal and BST invariants with explicit height, ordering, duplicate, node-identity and range-output contracts.

  8. Heaps & Priority Queues

    Apply heap invariants to top-K, merging, medians and weighted paths while accounting for ties, storage and update costs.

  9. Graphs — Representation, BFS, DFS, Shortest Path

    Represent graphs and derive traversal, connectivity and shortest-path algorithms under explicit vertex, ordering and edge-weight contracts.

  10. Sorting — Merge, Quick, and When to Trust the Built-in

    Compare merge, quick and heap sorting with explicit stability, comparator, storage and worst-case contracts, including when to use Python built-ins.

  11. Dynamic Programming — Memoisation & Tabulation

    Define states, transitions, base cases and evaluation order; derive time and storage from the actual state space rather than assuming polynomial complexity.

  12. Greedy & Backtracking — When to Use Each

    Prove greedy choices for the precise objective, and build complete backtracking searches with correct undo, sound pruning and explicit output costs.

Browse all articles

Learning paths

Prefer a guided sequence? Explore connected lessons, examples, and interactive experiments by subject.

Explore learning paths