CS · Card catalogue

The algorithms catalogue

Algorithms and data structures at work on real problems: Dijkstra's wave runs through the streets of Almaty, a Bloom filter looks a password up in a list of leaks, binary search finds the commit that broke everything. Python and Go code runs right on the page, problems are judged on the server, and every one has a walkthrough.

57 articles 98 problems Python and Go

All tags

Where to start

New to algorithms? Go through these cards in order. Everything else reads in any order.

  1. 1Big O
  2. 2Binary search
  3. 3Binary heap
  4. 4Breadth-first search
  5. 5Dijkstra's algorithm
  6. 6Dynamic programming
  7. 7How to benchmark honestly
SRT

Searching and sorting

3 cards
DS

Data structures

8 cards
GRA

Graphs

11 cards
GRA Algorithm Breadth-first search Walks a graph in layers and finds paths with the fewest edges in O(V + E). O(V + E) 2 problems GRA Algorithm Depth-first search Goes deep, marks each vertex's entry and exit and finds cycles by them in O(V + E). O(V + E) 2 problems GRA Algorithm Bridges and articulation points Streets and crossroads without which a graph falls apart: one depth-first search with the numbers tin and low, O(V + E). O(V + E) 2 problems GRA Algorithm Dijkstra's algorithm Shortest paths from one vertex in a weighted graph without negative edges. O((V + E) log V) 3 problems GRA Algorithm A* Dijkstra with a hint of how far is left: the wave stretches towards the goal, and the path stays shortest. O((V + E) log V) 2 problems GRA Algorithm Bidirectional search Two Dijkstra waves towards each other: where to stop, how much is saved, and how to make it work with A*. O((V + E) log V) 2 problems GRA Algorithm The Bellman–Ford algorithm Shortest paths with negative edges and finding a negative cycle: V rounds over all edges. O(V · E) 2 problems GRA Algorithm Contraction hierarchies A navigator's precomputation: contract unimportant crossroads into shortcuts and find the path with two waves going up. O((V + E′) log V) 1 problem GRA Algorithm Dinic's algorithm Maximum flow in phases: a layered network, a blocking flow, pointers; O(V²E), and O(E√V) in unit networks. O(V² E) 2 problems GRA Algorithm Bipartite matching The largest number of pairs in a bipartite graph: Kuhn, Hopcroft–Karp, the theorems of König and Hall. O(E √V) 2 problems GRA Algorithm Centroid decomposition Splitting a tree by centroids: log₂ n levels, and the nearest marked vertex in O(log n) after every mark. O(log n) per mark and per question 1 problem
STR

Strings and text

5 cards
DP

Dynamic programming

5 cards
PAR

Paradigms

4 cards
NUM

Numbers and algebra

2 cards
GEO

Geometry

2 cards
NUM~

Numerical methods

1 card
SYS

Systems and big data

4 cards
ML

Data and machine learning

4 cards
TEC

Techniques

8 cards

How to estimate the time before running, how to measure honestly, and how to speed up without new hardware.

Problems

Problems for every algorithm and technique. Write a solution in Python or Go, the server runs it against tests, and the walkthrough opens step by step: a hint, the idea, the solution, the usual mistakes.

All problems · 98

All tags