/Algorithms

Solutions for competitive programming problems in various online judges such as Kattis, SPOJ, URI Online Judge, etc.

Primary LanguageC++

Algorithms

Index

Note: This index is not exhaustive.

Strings

Trie

Suffix Array

Suffix Automaton

KMP

Segment Tree, Fenwick Tree

Segment Tree

Segment Tree + Lazy Propagation

BIT (Fenwick Tree)

Merge Sort Tree

2D Segment Tree

Geometry

Radial Sweep (and Polar Sort)

Convex Hull

Sweep Line

Quadrilaterals

Segment to Segment Distance

Circle & Segment Intersection

Tangents & Arcs

Polygon Tangents

Geometry with Dynamic Programming

Convex Polygons + Two-Pointers

Concave Polygons

Point Inside Polygon

Polygon Intersection

Half-Planes Intersection (Finite Area)

Rectangle-Rectangle Intersection

Simple Polygon Detection

Misc

Graphs

BFS, DFS

Bipartite Matching, Max Flow, Min-Cut

Minimum Cost Flow

Dijkstra

Bellman-Ford

Topological Sort

Minimum Dominating Set

Hungarian Algorithm for Assignment Problem

Dynamic Programming

Counting, Combinatorics, Math

Maximization, Minimization

Probability

Binary Search, Ternary Search

Binary Search

Ternary Search

Trees

Tree Problems

Cycle Detection

Other Data Structures & Algorithms

Fast Fourier Transform

Union Find (+ Minimum Spanning Tree)

Sparse Table

Prefix Sum

Lowest Common Ancestor

Coordinate (or Arrays in General) Compression

Rope

Ordered Set

Fast Exponentiation, Fast Fibonacci, Etc

Modular Division

Simpson's Integration

Kadane's Algorithm (Maximum Subarray Problem)