CS
Algorithms
Problems Base course RU

Found in

images

Articles

DS Data structure Disjoint set union Merge two sets and tell whether elements are in the same one, in almost O(1): a forest of parent links and two tricks. O(α(n)) 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 ML Algorithm k-means Splits points into k groups so that points sit close to the centre of their group. O(n · k · d) per step 2 problems ML Algorithm Perceptron and backpropagation Draw a digit: a perceptron from 1958 and a network with a hidden layer, both trained right in the page in a second, read it. perceptron: O(d) per example; network gradient: O(number of weights) per example 1 problem TEC Technique Cache-friendly data The same algorithm, a different order of memory accesses: tiling, padded rows and laying data out by field. the same big O 1 problem

Problems

The nearest palette colour A domino mosaic Dark islands The quadtree of a photo

Often together

classic 3 array 2 interviews 2 iterative 2 disjoint sets 1 connectivity 1 tree 1 amortized 1 offline queries 1 maps and navigation 1 science and physics 1 matching 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