\[ \let\oldlor\lor \renewcommand{\lor}{\; \oldlor \;} \let\oldland\land \renewcommand{\land}{\; \oldland \;} \renewcommand{\set}[1]{\{\, #1 \,\}} \renewcommand{\given}{\,\mid\,} \renewcommand{\abs}[1]{\lvert #1 \rvert} \renewcommand{\divs}{\!\;\mid\;\!} \renewcommand{\ndivs}{\!\;\nmid\;\!} \renewcommand{\betw}[3][1]{#1 \leq #2 \leq #3} \renewcommand{\mod}[1]{\ (\mathrm{mod}\ #1)} \renewcommand{\floor}[1]{\left \lfloor #1 \right \rfloor} \renewcommand{\ceil}[1]{\left \lceil #1 \right \rceil} \renewcommand{\t}[1]{\texttt{#1}} \renewcommand{\fori}[2][i]{\text{for } #1 = 0, 1, \dots, #2} \renewcommand{\x}[1]{\text{#1}} \renewcommand\concat{\mathbin{+\mkern-10mu+}} \DeclareMathOperator*{\CONCAT}{\concat} \DeclareMathOperator*{\SCC}{\|} \]

Algorithms and Data Structures

Learn about algorithms and data structures for computer science, by studying their various implementations and use cases.
Category Title Description Tags
Algorithm BFS Breadth-first graph traversal search
Algorithm DFS Depth-first graph traversal search
Algorithm Dijkstra Single source, shortest path
Algorithm Fibonacci Compute N-th Fibonacci number quickly with matrix exponentiation
Algorithm FizzBuzz The classic stupid interview problem
Algorithm GCD and LCM Euclid's algorithm
Algorithm Modular Exponentiation Compute X to the power N modulo M
Algorithm Prime Factorization Compute the prime factors of a non-negative integer N
Algorithm Sieve of Eratosthenes Bottom-up determination of primes
Data Structure Range Minimum Query With binary-lifting for constant-time queries.
Data Structure Union-Find Disjoint-Set With path compression for amortized time complexity