CS
Algorithms
Problems Base course RU

Method

streaming

Articles

STR Algorithm The Aho–Corasick algorithm Every occurrence of thousands of words in one pass: a trie of the words plus failure links, as in the prefix function. O(n + Σ|wᵢ| + z) 1 problem SYS Data structure Count-Min Sketch Frequencies of stream items in fixed memory: the minimum of d counters, with an error only upwards. O(d) per item and per query 2 problems SYS Data structure HyperLogLog The number of distinct elements of a stream in a kilobyte of memory: long runs of zeros in hashes and an average over registers. O(1) per element, O(m) per estimate 2 problems

Problems

A million temperatures A place in the catalogue Frequent words in one pass Rotations on the conveyor Seismic watch Two estimates The decoder The median over a window

Often together

in production 3 networks 2 sketch 2 hashing 2 probabilistic 2 analytics 2 string matching 1 automaton 1 trie 1 security 1 bioinformatics 1 classic 1

Written by Viacheslav Legostin. Everything is free; readers’ code is not stored.

Computer Science The algorithms catalogue Problems Base course Mathematics legost.in

The algorithms catalogue

Problems

SRT Searching and sorting

  1. Binary search
  2. Binary search on the answer
  3. Exponential search
  4. Interpolation search
  5. External sorting
  6. Heapsort
  7. Counting sort and radix sort

DS Data structures

  1. Dynamic array
  2. Hash table
  3. Cuckoo hashing
  4. Bloom filter
  5. Binary heap
  6. Binary search tree
  7. AVL tree
  8. B-tree
  9. Disjoint set union
  10. Fenwick tree

GRA Graphs

  1. Storing a graph
  2. Breadth-first search
  3. Depth-first search
  4. Bridges and articulation points
  5. Dijkstra's algorithm
  6. A*
  7. Bidirectional search
  8. The Bellman–Ford algorithm
  9. Floyd–Warshall algorithm
  10. Johnson's algorithm
  11. Contraction hierarchies
  12. Dinic's algorithm
  13. Graph colouring
  14. Bipartite matching
  15. Hungarian algorithm
  16. Eulerian path
  17. Heavy paths
  18. Centroid decomposition

STR Strings and text

  1. The Aho–Corasick algorithm
  2. Boyer–Moore
  3. The Burrows–Wheeler transform
  4. Edit distance
  5. BK-tree
  6. Huffman code

DP Dynamic programming

  1. Dynamic programming
  2. Interval DP
  3. Bitmask DP
  4. Digit DP
  5. Convex hull trick
  6. Knuth and divide-and-conquer optimisations

PAR Paradigms

  1. Greedy algorithms
  2. Backtracking
  3. Branch and bound
  4. Divide and conquer
  5. Closest pair of points

NUM Numbers and algebra

  1. Euclid's algorithm
  2. Fast exponentiation
  3. Chinese remainder theorem
  4. Big integers
  5. Fast Fourier transform
  6. Gaussian elimination

GEO Geometry

  1. Vectors and orientation
  2. Convex hull
  3. Delaunay triangulation and Voronoi diagram

NUM~ Numerical methods

  1. Bisection and Newton's method
  2. Gradient descent

SYS Systems and big data

  1. Consistent hashing
  2. Count-Min Sketch
  3. HyperLogLog
  4. Inverted index and BM25
  5. Retry with jitter
  6. CRDT

ML Data and machine learning

  1. k-means
  2. DBSCAN
  3. Decision tree
  4. Perceptron and backpropagation

RND Randomness

  1. Genetic algorithm

TEC Techniques

  1. Big O
  2. Fast input and output
  3. How to benchmark honestly
  4. Cache-friendly data
  5. Complexity from measurements
  6. Amortized analysis
  7. Choosing a data structure
  8. Coordinate compression
  9. Bit tricks