Skip to content

This project contains implementation and explanations of some data structures and algorithms.

Notifications You must be signed in to change notification settings

mihail-m/CP-implementations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data structures and algorithms library.


Repository with implementations and explanations of the following data structures and algorithms used in competitive programming.

Searching:

Sorting:

Basic Data Structures:

Graphs:

Fundamentals:

Advanced:

  • Shortest Path Faster Algorithm (SPFA)
  • Strongly connected components (Koraraju)
  • Boolean 2 satisfiability (2-SAT)
  • K-th ancestor
  • Lowest common ancestor (LCA)
  • Max flow (Dinic)
  • Max flow (MPM)
  • Min cost max flow (assignment problem)
  • Virtual tree
  • A*

String matching:

  • Rolling hash
  • Rabin Karp
  • Trie (Prefix Tree)
  • Knuth Morris Pratt (KMP)
  • Aho corasick (KMP Generalization)
  • Suffix array
  • Hash segment tree

Range Query:

  • Sqrt decomposition
  • Sparse table
  • 2D Sparse table
  • Fenwick tree (BITree)
  • Segment tree
  • 2D Segment Tree
  • Merge sort segment tree
  • Implicit treap

Persistance:

  • Persitent array
  • Persistent segment tree

Math:

  • Fast pow
  • Matrix fast pow
  • Sieve of Eratosthenes
  • Fast Fourier transform

Geometry:

  • Convex hull (Graham Scan)
  • KD tree