← Resources

Personal reference

DSA Notes

Data structures and algorithms, with real-world analogies, where you've probably already used them, and working JS.

22 topics · Practice problems → · Dictionary →

Fundamentals

Big O Notation
How to describe an algorithm's growth, not its speed.

Linear Structures

Array
Contiguous, indexed slots — instant access, expensive middle inserts.
Linked List
A chain of nodes — cheap inserts anywhere, no random access.
Stack
Last In, First Out — only the top is reachable.
Queue
First In, First Out — the checkout-line structure.
Deque
Push and pop from both ends — a stack and a queue in one.

Hash-Based Structures

HashMap
Key → value storage with ~O(1) average lookup.
HashSet
A HashMap that only remembers keys — 'have I seen this?' in O(1).

Trees & Heaps

Tree (General)
A hierarchy — one root, any number of children per node.
Binary Search Tree
A tree with an ordering rule — smaller left, bigger right.
Heap (Priority Queue)
A tree where the smallest (or biggest) item is always on top.
Trie (Prefix Tree)
A tree built for strings — shared prefixes, fast prefix search.

Graphs

Graph
Nodes and the connections between them — no strict hierarchy.
BFS & DFS
The two ways to walk a graph or tree — level by level, or all the way down first.
Dijkstra's Algorithm
Shortest path in a weighted graph — always expand the closest node.

Searching & Sorting

Binary Search
Find a value in a sorted array by halving the search space each step.
Merge Sort
Split, sort, merge — guaranteed O(n log n), and stable.
Quick Sort
Pick a pivot, partition around it, recurse — fast in-place sorting.

Techniques & Patterns

Two Pointers
Walk two positions through data instead of nesting loops.
Sliding Window
Keep a moving window over the data instead of recomputing from scratch.
Kadane's Algorithm
Maximum sum of a contiguous subarray, in one O(n) pass.

Dynamic Programming

Dynamic Programming
Cache overlapping subproblem results so you never recompute them.