Preface
1.
Basic Techniques
1.1.
Introduction
1.1.1.
Rust competitive helper
1.1.2.
Input and output
1.1.3.
Working with numbers
1.1.4.
Shortening code
1.1.5.
Mathematics
1.1.6.
Contests and resources
1.2.
Time complexity
1.2.1.
Calculation rules
1.2.2.
Complexity classes
1.2.3.
Estimating efficiency
1.2.4.
Maximum subarray sum
1.3.
Sorting
1.3.1.
Sorting theory
1.3.2.
Sorting in Rust
1.3.3.
Binary search
1.4.
Data structures
1.4.1.
Vectors
1.4.2.
Slices
1.4.3.
Set structures
1.4.4.
Map structures
1.4.5.
Iterators and ranges
1.4.6.
Other structures
1.4.7.
Comparison to sorting
1.5.
Complete search
1.5.1.
Generating subsets
1.5.2.
Generating permutations
1.5.3.
Backtracking
1.5.4.
Pruning the search
1.5.5.
Meet in the middle
1.6.
Greedy algorithms
1.6.1.
Coin problem
1.6.2.
Scheduling
1.6.3.
Tasks and deadlines
1.6.4.
Minimizing sums
1.6.5.
Data compression
1.7.
Dynamic programming
1.7.1.
Coin problem
1.7.2.
Longest increasing subsequence
1.7.3.
Paths in a grid
1.7.4.
Knapsack problems
1.7.5.
Edit distance
1.7.6.
Counting tilings
1.8.
Amortized analysis
1.8.1.
Two pointers method
1.8.2.
Nearest smaller elements
1.8.3.
Sliding window minimum
1.9.
Range queries
1.9.1.
Static array queries
1.9.2.
Binary indexed tree
1.9.3.
Segment tree
1.9.4.
Additional techniques
1.10.
Bit manipulation
1.10.1.
Bit representation
1.10.2.
Bit operations
1.10.3.
Representing sets
1.10.4.
Bit optimizations
1.10.5.
Dynamic programming
2.
Graph algorithms
2.1.
Basics of graphs
2.1.1.
Graph terminology
2.1.2.
Graph representation
2.2.
Graph traversal
2.2.1.
Depth-first search
2.2.2.
Breadth-first search
2.2.3.
Applications
2.3.
Shortest paths
2.3.1.
Bellman–Ford algorithm
2.3.2.
Dijkstra’s algorithm
2.3.3.
Floyd–Warshall algorithm
2.4.
Tree algorithms
2.4.1.
Tree traversal
2.4.2.
Diameter
2.4.3.
All longest paths
2.4.4.
Binary trees
2.5.
Spanning trees
2.5.1.
Kruskal’s algorithm
2.5.2.
Union-find structure
2.5.3.
Prim’s algorithm
2.6.
Directed graphs
2.6.1.
Topological sorting
2.6.2.
Dynamic programming
2.6.3.
Successor paths
2.6.4.
Cycle detection
2.7.
Strong connectivity
2.7.1.
Kosaraju’s algorithm
2.7.2.
2SAT problem
2.8.
Tree queries
2.8.1.
Finding ancestors
2.8.2.
Subtrees and paths
2.8.3.
Lowest common ancestor
2.8.4.
Offline algorithms
2.9.
Paths and circuits
2.9.1.
Eulerian paths
2.9.2.
Hamiltonian paths
2.9.3.
De Bruijn sequences
2.9.4.
Knight’s tours
2.10.
Flows and cuts
2.10.1.
Ford–Fulkerson algorithm
2.10.2.
Disjoint paths
2.10.3.
Maximum matchings
2.10.4.
Path covers
3.
Advanced topics
3.1.
Number theory
3.1.1.
Primes and factors
3.1.2.
Modular arithmetic
3.1.3.
Solving equations
3.1.4.
Other results
Light (default)
Rust
Coal
Navy
Ayu
Competitive Programmer's Handbook - Rust Edition
Complete search