\indexentry{programming language|hyperpage}{3} \indexentry{input and output|hyperpage}{4} \indexentry{integer|hyperpage}{6} \indexentry{remainder|hyperpage}{6} \indexentry{modular arithmetic|hyperpage}{6} \indexentry{floating point number|hyperpage}{7} \indexentry{tuppdef@\texttt{typedef}|hyperpage}{8} \indexentry{macro|hyperpage}{9} \indexentry{arithmetic progression|hyperpage}{10} \indexentry{Faulhaber's formula|hyperpage}{10} \indexentry{geometric progression|hyperpage}{11} \indexentry{harmonic sum|hyperpage}{11} \indexentry{set theory|hyperpage}{12} \indexentry{set|hyperpage}{12} \indexentry{intersection|hyperpage}{12} \indexentry{union|hyperpage}{12} \indexentry{difference|hyperpage}{12} \indexentry{subset|hyperpage}{12} \indexentry{universal set|hyperpage}{12} \indexentry{complement|hyperpage}{12} \indexentry{logic|hyperpage}{13} \indexentry{negation|hyperpage}{13} \indexentry{conjuction|hyperpage}{13} \indexentry{disjunction|hyperpage}{13} \indexentry{implication|hyperpage}{13} \indexentry{equivalence|hyperpage}{13} \indexentry{predicate|hyperpage}{13} \indexentry{quantifier|hyperpage}{13} \indexentry{factorial|hyperpage}{14} \indexentry{Fibonacci number|hyperpage}{14} \indexentry{Binet's formula|hyperpage}{14} \indexentry{logarithm|hyperpage}{14} \indexentry{natural logarithm|hyperpage}{15} \indexentry{time complexity|hyperpage}{17} \indexentry{complexity classes|hyperpage}{20} \indexentry{constant-time algorithm|hyperpage}{20} \indexentry{logarithmic algorithm|hyperpage}{20} \indexentry{linear algorithm|hyperpage}{20} \indexentry{quadratic algorithm|hyperpage}{20} \indexentry{cubic algorithm|hyperpage}{20} \indexentry{polynomial algorithm|hyperpage}{20} \indexentry{NP-hard problem|hyperpage}{20} \indexentry{constant factor|hyperpage}{21} \indexentry{maximum subarray sum|hyperpage}{21} \indexentry{Kadane's algorithm|hyperpage}{23} \indexentry{sorting|hyperpage}{25} \indexentry{bubble sort|hyperpage}{25} \indexentry{inversion|hyperpage}{26} \indexentry{merge sort|hyperpage}{27} \indexentry{counting sort|hyperpage}{28} \indexentry{sort@\texttt{sort}|hyperpage}{29} \indexentry{comparison operator|hyperpage}{30} \indexentry{pair@\texttt{pair}|hyperpage}{30} \indexentry{tuple@\texttt{tuple}|hyperpage}{30} \indexentry{comparison function|hyperpage}{31} \indexentry{binary search|hyperpage}{31} \indexentry{data structure|hyperpage}{35} \indexentry{dynamic array|hyperpage}{35} \indexentry{vector|hyperpage}{35} \indexentry{string|hyperpage}{36} \indexentry{set|hyperpage}{37} \indexentry{map|hyperpage}{38} \indexentry{iterator|hyperpage}{39} \indexentry{sort@\texttt{sort}|hyperpage}{39} \indexentry{reverse@\texttt{reverse}|hyperpage}{39} \indexentry{random\_shuffle@\texttt{random\_shuffle}|hyperpage}{39} \indexentry{bitset|hyperpage}{41} \indexentry{deque|hyperpage}{42} \indexentry{stack|hyperpage}{42} \indexentry{queue|hyperpage}{43} \indexentry{priority queue|hyperpage}{43} \indexentry{heap|hyperpage}{43} \indexentry{subset|hyperpage}{47} \indexentry{permutation|hyperpage}{49} \indexentry{next\_permutation@\texttt{next\_permutation}|hyperpage}{49} \indexentry{backtracking|hyperpage}{50} \indexentry{queen problem|hyperpage}{50} \indexentry{meet in the middle|hyperpage}{54} \indexentry{greedy algorithm|hyperpage}{57} \indexentry{data compression|hyperpage}{62} \indexentry{binary code|hyperpage}{62} \indexentry{codeword|hyperpage}{62} \indexentry{Huffman coding|hyperpage}{63} \indexentry{dynamic programming|hyperpage}{65} \indexentry{memoization|hyperpage}{67} \indexentry{longest increasing subsequence|hyperpage}{70} \indexentry{knapsack|hyperpage}{72} \indexentry{edit distance|hyperpage}{74} \indexentry{Levenshtein distance|hyperpage}{74} \indexentry{amortized analysis|hyperpage}{77} \indexentry{two pointers method|hyperpage}{77} \indexentry{2SUM problem|hyperpage}{78} \indexentry{3SUM problem|hyperpage}{79} \indexentry{nearest smaller elements|hyperpage}{79} \indexentry{sliding window|hyperpage}{81} \indexentry{sliding window minimum|hyperpage}{81} \indexentry{range query|hyperpage}{83} \indexentry{sum query|hyperpage}{83} \indexentry{minimum query|hyperpage}{83} \indexentry{maximum query|hyperpage}{83} \indexentry{prefix sum array|hyperpage}{84} \indexentry{sparse table|hyperpage}{85} \indexentry{binary indexed tree|hyperpage}{86} \indexentry{Fenwick tree|hyperpage}{86} \indexentry{segment tree|hyperpage}{89} \indexentry{index compression|hyperpage}{93} \indexentry{difference array|hyperpage}{93} \indexentry{bit representation|hyperpage}{95} \indexentry{and operation|hyperpage}{96} \indexentry{or operation|hyperpage}{96} \indexentry{xor operation|hyperpage}{97} \indexentry{not operation|hyperpage}{97} \indexentry{bit shift|hyperpage}{97} \indexentry{Hamming distance|hyperpage}{100} \indexentry{graph|hyperpage}{109} \indexentry{node|hyperpage}{109} \indexentry{edge|hyperpage}{109} \indexentry{path|hyperpage}{109} \indexentry{cycle|hyperpage}{109} \indexentry{connected graph|hyperpage}{110} \indexentry{component|hyperpage}{110} \indexentry{tree|hyperpage}{110} \indexentry{directed graph|hyperpage}{110} \indexentry{weighted graph|hyperpage}{111} \indexentry{neighbor|hyperpage}{111} \indexentry{degree|hyperpage}{111} \indexentry{regular graph|hyperpage}{111} \indexentry{complete graph|hyperpage}{111} \indexentry{indegree|hyperpage}{111} \indexentry{outdegree|hyperpage}{111} \indexentry{coloring|hyperpage}{112} \indexentry{bipartite graph|hyperpage}{112} \indexentry{simple graph|hyperpage}{112} \indexentry{adjacency list|hyperpage}{113} \indexentry{adjacency matrix|hyperpage}{114} \indexentry{edge list|hyperpage}{115} \indexentry{depth-first search|hyperpage}{117} \indexentry{breadth-first search|hyperpage}{119} \indexentry{connected graph|hyperpage}{121} \indexentry{cycle|hyperpage}{121} \indexentry{bipartite graph|hyperpage}{122} \indexentry{shortest path|hyperpage}{123} \indexentry{Bellman–Ford algorithm|hyperpage}{123} \indexentry{negative cycle|hyperpage}{125} \indexentry{SPFA algorithm|hyperpage}{126} \indexentry{Dijkstra's algorithm|hyperpage}{126} \indexentry{Floyd–Warshall algorithm|hyperpage}{129} \indexentry{tree|hyperpage}{133} \indexentry{leaf|hyperpage}{133} \indexentry{root|hyperpage}{133} \indexentry{rooted tree|hyperpage}{133} \indexentry{child|hyperpage}{133} \indexentry{parent|hyperpage}{133} \indexentry{subtree|hyperpage}{133} \indexentry{diameter|hyperpage}{135} \indexentry{binary tree|hyperpage}{139} \indexentry{pre-order|hyperpage}{139} \indexentry{in-order|hyperpage}{139} \indexentry{post-order|hyperpage}{139} \indexentry{spanning tree|hyperpage}{141} \indexentry{minimum spanning tree|hyperpage}{141} \indexentry{maximum spanning tree|hyperpage}{142} \indexentry{Kruskal's algorithm|hyperpage}{142} \indexentry{union-find structure|hyperpage}{145} \indexentry{Prim's algorithm|hyperpage}{147} \indexentry{topological sorting|hyperpage}{149} \indexentry{cycle|hyperpage}{149} \indexentry{Dijkstra's algorithm|hyperpage}{153} \indexentry{successor graph|hyperpage}{154} \indexentry{functional graph|hyperpage}{154} \indexentry{cycle|hyperpage}{155} \indexentry{cycle detection|hyperpage}{155} \indexentry{Floyd's algorithm|hyperpage}{156} \indexentry{strongly connected graph|hyperpage}{157} \indexentry{strongly connected component|hyperpage}{157} \indexentry{component graph|hyperpage}{157} \indexentry{Kosaraju's algorithm|hyperpage}{158} \indexentry{2SAT problem|hyperpage}{160} \indexentry{3SAT problem|hyperpage}{162} \indexentry{tree query|hyperpage}{163} \indexentry{ancestor|hyperpage}{163} \indexentry{tree traversal array|hyperpage}{164} \indexentry{lowest common ancestor|hyperpage}{167} \indexentry{Euler tour technique|hyperpage}{168} \indexentry{Eulerian path|hyperpage}{173} \indexentry{Eulerian circuit|hyperpage}{174} \indexentry{Hierholzer's algorithm|hyperpage}{175} \indexentry{Hamiltonian path|hyperpage}{177} \indexentry{Hamiltonian circuit|hyperpage}{177} \indexentry{Dirac's theorem|hyperpage}{177} \indexentry{Ore's theorem|hyperpage}{177} \indexentry{De Bruijn sequence|hyperpage}{178} \indexentry{knight's tour|hyperpage}{179} \indexentry{heuristic|hyperpage}{179} \indexentry{Warnsdorf's rule|hyperpage}{179} \indexentry{flow|hyperpage}{181} \indexentry{maximum flow|hyperpage}{181} \indexentry{cut|hyperpage}{182} \indexentry{minimum cut|hyperpage}{182} \indexentry{Ford–Fulkerson algorithm|hyperpage}{182} \indexentry{Edmonds–Karp algorithm|hyperpage}{184} \indexentry{scaling algorithm|hyperpage}{185} \indexentry{minimum cut|hyperpage}{185} \indexentry{matching|hyperpage}{187} \indexentry{maximum matching|hyperpage}{187} \indexentry{Hall's theorem|hyperpage}{189} \indexentry{perfect matching|hyperpage}{189} \indexentry{Kőnig's theorem|hyperpage}{189} \indexentry{node cover|hyperpage}{189} \indexentry{minimum node cover|hyperpage}{189} \indexentry{independent set|hyperpage}{190} \indexentry{maximum independent set|hyperpage}{190} \indexentry{path cover|hyperpage}{190} \indexentry{Dilworth's theorem|hyperpage}{193} \indexentry{antichain|hyperpage}{193} \indexentry{number theory|hyperpage}{197} \indexentry{divisibility|hyperpage}{197} \indexentry{factor|hyperpage}{197} \indexentry{divisor|hyperpage}{197} \indexentry{prime|hyperpage}{197} \indexentry{prime decomposition|hyperpage}{197} \indexentry{perfect number|hyperpage}{198} \indexentry{Goldbach's conjecture|hyperpage}{199} \indexentry{twin prime|hyperpage}{199} \indexentry{Legendre's conjecture|hyperpage}{199} \indexentry{sieve of Eratosthenes|hyperpage}{200} \indexentry{harmonic sum|hyperpage}{200} \indexentry{greatest common divisor|hyperpage}{200} \indexentry{least common multiple|hyperpage}{200} \indexentry{Euclid's algorithm|hyperpage}{200} \indexentry{coprime|hyperpage}{201} \indexentry{Euler's totient function|hyperpage}{201} \indexentry{modular arithmetic|hyperpage}{201} \indexentry{Fermat's theorem|hyperpage}{202} \indexentry{Euler's theorem|hyperpage}{202} \indexentry{modular inverse|hyperpage}{202} \indexentry{Diophantine equation|hyperpage}{204} \indexentry{extended Euclid's algorithm|hyperpage}{204} \indexentry{Chinese remainder theorem|hyperpage}{205} \indexentry{Lagrange's theorem|hyperpage}{205} \indexentry{Zeckendorf's theorem|hyperpage}{206} \indexentry{Fibonacci number|hyperpage}{206} \indexentry{Pythagorean triple|hyperpage}{206} \indexentry{Euclid's formula|hyperpage}{206} \indexentry{Wilson's theorem|hyperpage}{206} \indexentry{combinatorics|hyperpage}{207} \indexentry{binomial coefficient|hyperpage}{208} \indexentry{Pascal's triangle|hyperpage}{209} \indexentry{multinomial coefficient|hyperpage}{210} \indexentry{Catalan number|hyperpage}{210} \indexentry{parenthesis expression|hyperpage}{211} \indexentry{inclusion-exclusion|hyperpage}{212} \indexentry{derangement|hyperpage}{213} \indexentry{Burnside's lemma|hyperpage}{214} \indexentry{Cayley's formula|hyperpage}{215} \indexentry{Prüfer code|hyperpage}{216} \indexentry{matrix|hyperpage}{217} \indexentry{vector|hyperpage}{217} \indexentry{transpose|hyperpage}{217} \indexentry{square matrix|hyperpage}{217} \indexentry{matrix multiplication|hyperpage}{218} \indexentry{identity matrix|hyperpage}{218} \indexentry{matrix power|hyperpage}{219} \indexentry{determinant|hyperpage}{219} \indexentry{cofactor|hyperpage}{219} \indexentry{inverse matrix|hyperpage}{220} \indexentry{linear recurrence|hyperpage}{220} \indexentry{Fibonacci number|hyperpage}{220} \indexentry{Kirchhoff's theorem|hyperpage}{223} \indexentry{spanning tree|hyperpage}{223} \indexentry{Laplacean matrix|hyperpage}{224} \indexentry{probability|hyperpage}{225} \indexentry{conditional probability|hyperpage}{227} \indexentry{independence|hyperpage}{228} \indexentry{random variable|hyperpage}{228} \indexentry{expected value|hyperpage}{229} \indexentry{distribution|hyperpage}{229} \indexentry{uniform distribution|hyperpage}{230} \indexentry{binomial distribution|hyperpage}{230} \indexentry{geometric distribution|hyperpage}{230} \indexentry{Markov chain|hyperpage}{230} \indexentry{randomized algorithm|hyperpage}{231} \indexentry{Monte Carlo algorithm|hyperpage}{231} \indexentry{Las Vegas algorithm|hyperpage}{231} \indexentry{order statistic|hyperpage}{232} \indexentry{matrix multiplication|hyperpage}{232} \indexentry{quicksort|hyperpage}{232} \indexentry{quickselect|hyperpage}{232} \indexentry{Freivalds' algoritm|hyperpage}{232} \indexentry{coloring|hyperpage}{233} \indexentry{winning state|hyperpage}{235} \indexentry{losing state|hyperpage}{235} \indexentry{nim game|hyperpage}{237} \indexentry{nim sum|hyperpage}{237} \indexentry{misère game|hyperpage}{238} \indexentry{Sprague–Grundy theorem|hyperpage}{238} \indexentry{Grundy number|hyperpage}{238} \indexentry{mex function|hyperpage}{238} \indexentry{Grundy's game|hyperpage}{241} \indexentry{pattern matching|hyperpage}{243} \indexentry{string|hyperpage}{243} \indexentry{alphabet|hyperpage}{243} \indexentry{substring|hyperpage}{243} \indexentry{subsequence|hyperpage}{243} \indexentry{prefix|hyperpage}{243} \indexentry{suffix|hyperpage}{243} \indexentry{rotation|hyperpage}{243} \indexentry{period|hyperpage}{243} \indexentry{border|hyperpage}{244} \indexentry{lexicographical order|hyperpage}{244} \indexentry{trie|hyperpage}{244} \indexentry{hashing|hyperpage}{245} \indexentry{string hashing|hyperpage}{245} \indexentry{hash value|hyperpage}{245} \indexentry{polynomial hashing|hyperpage}{245} \indexentry{collision|hyperpage}{246} \indexentry{birthday paradox|hyperpage}{247} \indexentry{Z-algorithm|hyperpage}{247} \indexentry{Z-array|hyperpage}{247} \indexentry{square root algorithm|hyperpage}{251} \indexentry{Mo's algorithm|hyperpage}{255} \indexentry{segment tree|hyperpage}{257} \indexentry{lazy propagation|hyperpage}{258} \indexentry{lazy segment tree|hyperpage}{258} \indexentry{dynamic segment tree|hyperpage}{261} \indexentry{sparse segment tree|hyperpage}{261} \indexentry{persistent segment tree|hyperpage}{262} \indexentry{two-dimensional segment tree|hyperpage}{264} \indexentry{geometry|hyperpage}{265} \indexentry{Heron's formula|hyperpage}{265} \indexentry{complex number|hyperpage}{266} \indexentry{point|hyperpage}{266} \indexentry{vector|hyperpage}{266} \indexentry{complex@\texttt{complex}|hyperpage}{266} \indexentry{cross product|hyperpage}{268} \indexentry{line segment intersection|hyperpage}{269} \indexentry{shoelace formula|hyperpage}{271} \indexentry{Pick's theorem|hyperpage}{272} \indexentry{distance function|hyperpage}{272} \indexentry{Euclidean distance|hyperpage}{272} \indexentry{Manhattan distance|hyperpage}{272} \indexentry{sweep line|hyperpage}{275} \indexentry{intersection point|hyperpage}{276} \indexentry{closest pair|hyperpage}{277} \indexentry{Andrew's algorithm|hyperpage}{279}