DSA guides
Read how each data structure works, then see it implemented in Python, JavaScript, Java and C++.
Arrays & Strings
Big-O and Complexity
How to describe how fast code grows as its input grows, and why O(n log n) beats O(n²) long before your computer runs out of patience.
Arrays and Dynamic Arrays
Why reading arr[i] is instant, why inserting at the front is slow, and how lists that grow (Python list, ArrayList, vector) work underneath.
Prefix Sums and Difference Arrays
Precompute cumulative information for constant-time range queries, then reverse the idea to apply many range updates efficiently.
Linked Lists
Stacks & Queues
Stacks
Last in, first out. How a stack works, how to build one on top of an array, and the problems it solves, from matching brackets to undo.
Queues and Deques
First in, first out. How a queue works, why a circular buffer makes both ends O(1), and where queues show up, from schedulers to breadth-first search.
Hashing
Searching & Sorting
Sorting Algorithms and Their Trade-offs
Compare insertion sort, merge sort and quicksort, understand stability, and choose a sorting strategy from the shape of the data.
Binary Search and Boundary Finding
Search sorted data in logarithmic time, find first and last valid positions, and binary-search an answer when feasibility is monotonic.
Recursion & Backtracking
Trees & Graphs
Binary Trees and Traversals
Roots, children and leaves; the four ways to walk a tree (pre-, in-, post- and level-order); and how recursion makes tree code short.
Binary Search Trees
A binary tree that keeps itself sorted. How search, insert and the three cases of delete work, and why balance decides whether it's O(log n) or O(n).
Graphs, BFS and DFS
Vertices and edges, adjacency lists, and the two ways to explore a graph: breadth-first search for shortest paths and depth-first search for everything else.
Weighted Graphs, Dijkstra and Union–Find
Extend BFS to weighted shortest paths, connect a graph at minimum cost, and maintain changing components with union–find.