CS
Algorithms
Problems Base course RU

Method

greedy

Articles

SRT Technique Binary search on the answer If checking an answer is easier than finding it, and the check is monotone, search for the answer by halving. O(log D · cost of a check) 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 ML Algorithm Decision tree Answers with a chain of questions “feature ≤ threshold?”; each question is chosen so that uncertainty falls the most. O(h · F · n log n) to build; O(h) to answer 2 problems

Problems

A novel in k days Bike stations The best first question A tree by Gini

Often together

classic 3 interviews 3 binary search 1 searching 1 optimization 1 contests 1 shortest path 1 heap 1 weighted graph 1 graph 1 maps and navigation 1 networks 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. External sorting
  5. Counting sort and radix sort

DS Data structures

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

GRA Graphs

  1. Breadth-first search
  2. Depth-first search
  3. Bridges and articulation points
  4. Dijkstra's algorithm
  5. A*
  6. Bidirectional search
  7. The Bellman–Ford algorithm
  8. Floyd–Warshall algorithm
  9. Contraction hierarchies
  10. Dinic's algorithm
  11. Bipartite matching
  12. Eulerian path
  13. 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

DP Dynamic programming

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

PAR Paradigms

  1. Backtracking
  2. Branch and bound
  3. Divide and conquer
  4. 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

GEO Geometry

  1. Convex hull
  2. Delaunay triangulation and Voronoi diagram

NUM~ Numerical methods

  1. Bisection and Newton's method

SYS Systems and big data

  1. Consistent hashing
  2. Count-Min Sketch
  3. Retry with jitter
  4. CRDT

ML Data and machine learning

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

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