Visual Learning Index

Every page is an animation you can play, step through and edit. Read in order: each page assumes the ones before it. Open this folder's pages by double-clicking them; no internet needed.

Part 1: Go, concept by concept

1. Variables and MemorySee a Go variable as a named box in memory: declare, assign, copy, zero values and shadowing. 2. PointersUnderstand Go pointers with boxes and arrows: address-of, dereference, pass by value vs pointer, structs, nil and panics. 3. Arrays vs SlicesSee a slice as a small header (pointer, length, capacity) over a backing array: append, growth, aliasing and the 3-index slice. 4. MapsSee a Go map as a phone book: set, overwrite, look up with comma-ok, delete, nil map panic and random iteration order. 5. Functions and the Call StackWatch stack frames pushed and popped as functions are called, return multiple values and recurse. 6. ClosuresSee how a Go closure carries its own captured variables, and how the Go 1.22 loop variable change fixed a classic bug. 7. Defer, Panic and RecoverWatch the defer stack run last-in-first-out, a panic unwind the stack, and recover catch it. 8. Strings, Bytes and RunesSee how a Go string is a row of UTF-8 bytes, why len counts bytes, and how runes and range give you characters. 9. Structs and MethodsSee why a value receiver changes a copy while a pointer receiver changes the original, and why range copies struct elements. 10. InterfacesSee an interface value as a (type, value) pair, how method calls pick the right code, and the nil-interface gotcha. 11. Goroutines and ChannelsWatch goroutines hand values through unbuffered and buffered channels, including blocking and close. 12. Select and TimeoutsWatch select wait on several channels and run whichever is ready first, with a timeout and a default case. 13. Mutex and Data RaceStep through two goroutines doing counter++ at the same time, see an update get lost, then fix it with a mutex. 14. WaitGroup and Worker PoolWatch a fixed set of workers pull jobs from a channel while a WaitGroup counts outstanding work. 15. Context and CancellationSee how a context carries a cancel signal and deadline down to the goroutines doing work, and how cancelling a parent cancels its children.

Part 2: Data structures and algorithms

1. Binary SearchFind a value in a sorted list by repeatedly checking the middle and throwing away the half that cannot contain it. 2. Two PointersWalk two markers through a list, from both ends or side by side, to solve pair and in-place problems without nested loops. 3. Sliding WindowSlide a window across a list, adding the new item and dropping the old one, instead of recomputing from scratch. 4. Hash Map: Two SumRemember what you have seen in a map so each lookup is instant, turning a nested loop into one pass. 5. Prefix SumPre-compute running totals once so the sum of any range can be answered instantly. 6. Stack: Valid ParenthesesUse a last-in-first-out stack to check that every bracket is closed in the right order. 7. Queue & Monotonic StackSee first-in-first-out queues, and a stack kept in order that finds the next greater element in one pass. 8. Linked ListSee how list nodes point to each other, how reversing flips the arrows, and how fast and slow pointers detect a cycle. 9. SortingWatch bubble, insertion, merge and quick sort compare and move items step by step. 10. Recursion Call TreeWatch every function call of fibonacci appear in a tree, then see memoization cut the repeated work. 11. BacktrackingExplore choices, undo the last one when stuck, and try the next, shown as a decision tree and an N-Queens board. 12. Tree TraversalsWatch preorder, inorder, postorder (with a live call stack) and level-order (with a queue) walk a binary tree. 13. BST Insert and SearchBuild a binary search tree one value at a time, then search it, and see how left/right choices narrow the search like binary search. 14. Trie (Prefix Tree)Build a trie (prefix tree) letter by letter, then search for whole words and prefixes while watching shared prefixes get reused. 15. Heap / Priority QueueSee a min-heap as both an array and a tree: push (sift up), pop (sift down) and heapify, one swap at a time. 16. Graph BFS / DFSExplore a graph with breadth-first search (a queue) and depth-first search (a stack), and watch the visited set and visit order build up. 17. Topological SortOrder tasks so every prerequisite comes first using Kahn's algorithm, and see how a cycle gets detected. 18. Dijkstra's Shortest PathFind the shortest paths from one node in a weighted graph with Dijkstra's algorithm, watching distances and the priority queue update. 19. Union-FindWatch union-find (disjoint sets) merge groups as a forest, with union by size and path compression shortening the trees. 20. Dynamic Programming TableDynamic programming as a table you fill cell by cell: climbing stairs, longest common subsequence and 0/1 knapsack, with each cell's sources highlighted. 21. Merge IntervalsMerge overlapping intervals on a number line: sort by start, then sweep and extend or start a new interval. 22. Bit ManipulationSee numbers as rows of bits and watch AND, OR, XOR, shifts, n&(n-1), counting set bits and the XOR single-number trick work column by column.