CS
Algorithms
Problems Base course RU

Solves

estimation

Articles

GRA Technique Storing a graph Matrix, lists, edge list and CSR: memory, speed, and which questions each form answers cheaply. neighbours of a vertex: O(n) for the matrix, O(deg) for lists and CSR; is there an edge: O(1) for the matrix, O(deg) for lists 2 problems TEC Technique Big O How work grows with the data: O, Ω and Θ, rules for estimating code, and where asymptotics mislead. estimated from the program text 1 problem TEC Technique How to benchmark honestly Repetitions, warm-up, median and minimum, timeit and testing.Benchmark—and the usual ways to fool yourself with a measurement. enough repetitions for a series to take at least a tenth of a second 1 problem TEC Technique Complexity from measurements The growth of running time from measurements: the slope, the ratio test, exponentials, and where measurement lies. O(B) per attempt 1 problem

Problems

Is there such a street piece Size the filter A verdict from measurements How many schemata survive The k-th root Cache misses How many times the line runs

Often together

interviews 4 measurement 3 classic 2 in production 2 graph 1 matrix 1 array 1 hash table 1 cache-friendly 1 maps and navigation 1 contests 1 sorting 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