/CP-algorithms

Implementations of various algorithms/data structures for CP.

Primary LanguageC++

CP-algorithms

This repo contains C++ implementations of the following algorithms/data structures which are useful for competitive programming contests(ICPC, Codeforces, etc).

  • Convex Hull Algorithm
    • Graham Scan
  • Dynamic Programming Tricks
    • Dynamic Convex Hull Trick (not fully tested)
    • LineContainer.h (source)
  • Fenwick Tree
    • Fenwick Tree
  • Network Flow
    • Edmonds-Karp Algorithm
    • Dinic's Algorithm
  • SCC
    • Kosaraju
  • Segment Tree
    • Segment Tree (with recursive implementation)
    • Segment Tree w/ Lazy Propagation
    • Merge Sort Tree
    • Persistent Segment Tree
  • String Matching
    • Knuth–Morris–Pratt
    • Manber-Myers(Suffix Array) + LCP Array
  • Tree Algorithms
    • Heavy Light Decomposition
    • Least Common Ancestor