⌂ mahinops.github.io · বাংলা
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 Memory See a Go variable as a named box in memory: declare, assign, copy, zero values and shadowing.
2. Pointers Understand Go pointers with boxes and arrows: address-of, dereference, pass by value vs pointer, structs, nil and panics.
3. Arrays vs Slices See a slice as a small header (pointer, length, capacity) over a backing array: append, growth, aliasing and the 3-index slice.
4. Maps See 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 Stack Watch stack frames pushed and popped as functions are called, return multiple values and recurse.
6. Closures See 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 Recover Watch the defer stack run last-in-first-out, a panic unwind the stack, and recover catch it.
8. Strings, Bytes and Runes See 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 Methods See why a value receiver changes a copy while a pointer receiver changes the original, and why range copies struct elements.
10. Interfaces See an interface value as a (type, value) pair, how method calls pick the right code, and the nil-interface gotcha.
11. Goroutines and Channels Watch goroutines hand values through unbuffered and buffered channels, including blocking and close.
12. Select and Timeouts Watch select wait on several channels and run whichever is ready first, with a timeout and a default case.
13. Mutex and Data Race Step through two goroutines doing counter++ at the same time, see an update get lost, then fix it with a mutex.
14. WaitGroup and Worker Pool Watch a fixed set of workers pull jobs from a channel while a WaitGroup counts outstanding work.
15. Context and Cancellation See 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 Search Find a value in a sorted list by repeatedly checking the middle and throwing away the half that cannot contain it.
2. Two Pointers Walk two markers through a list, from both ends or side by side, to solve pair and in-place problems without nested loops.
3. Sliding Window Slide a window across a list, adding the new item and dropping the old one, instead of recomputing from scratch.
4. Hash Map: Two Sum Remember what you have seen in a map so each lookup is instant, turning a nested loop into one pass.
5. Prefix Sum Pre-compute running totals once so the sum of any range can be answered instantly.
6. Stack: Valid Parentheses Use a last-in-first-out stack to check that every bracket is closed in the right order.
7. Queue & Monotonic Stack See first-in-first-out queues, and a stack kept in order that finds the next greater element in one pass.
8. Linked List See how list nodes point to each other, how reversing flips the arrows, and how fast and slow pointers detect a cycle.
9. Sorting Watch bubble, insertion, merge and quick sort compare and move items step by step.
10. Recursion Call Tree Watch every function call of fibonacci appear in a tree, then see memoization cut the repeated work.
11. Backtracking Explore choices, undo the last one when stuck, and try the next, shown as a decision tree and an N-Queens board.
12. Tree Traversals Watch preorder, inorder, postorder (with a live call stack) and level-order (with a queue) walk a binary tree.
13. BST Insert and Search Build 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 Queue See 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 / DFS Explore 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 Sort Order tasks so every prerequisite comes first using Kahn's algorithm, and see how a cycle gets detected.
18. Dijkstra's Shortest Path Find the shortest paths from one node in a weighted graph with Dijkstra's algorithm, watching distances and the priority queue update.
19. Union-Find Watch union-find (disjoint sets) merge groups as a forest, with union by size and path compression shortening the trees.
20. Dynamic Programming Table Dynamic 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 Intervals Merge overlapping intervals on a number line: sort by start, then sweep and extend or start a new interval.
22. Bit Manipulation See 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.