CS
Algorithms
Problems Base course RU

Built on

heap

Articles

DS Data structure Binary heap The minimum at hand, insertion and extraction in O(log n): the tree in an array that event calendars live on. O(log n) 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 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 TEC Technique Choosing a data structure First the list of operations, then the structure: the cost of each operation in Python and Go on one map. depends on the choice 1 problem

Problems

A stop on the way Orders by deadline Seismic watch The courier's route Fire stations One free ride Queries over the tiers The median over a window The fifteen puzzle in the fewest moves

Often together

interviews 5 shortest path 4 weighted graph 4 graph 4 maps and navigation 4 classic 3 in production 3 heuristic 3 array 2 precomputation 2 tree 1 scheduling 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