Skip to content

pawel-kieliszczyk/algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithms and data structures

Overview

C++ library of algorithms and data structures focused on easy use and very high performance. Might be useful in algorithmic competitions such as TopCoder or Sphere Online Judge. This is a header only library compatible with C++03 standard.

Continuous integration status

Build Status Coverage Status

Performance

The library focuses on high performance both minimizing computational complexity of all algorithms and maximizing possibility of efficient CPU caching. All data structures have fixed but custom maximum capacity and perform no memory reallocations once constructed.

Features

  • STL-like containers
  • popular algorithms and data structures
  • graph library
  • compile-time algorithms

Data structures

  • vector
  • stack
  • queue
  • priority queue
  • cyclic array
  • disjoint sets
  • interval tree (1D, 2D, 3D and 4D)
  • binary indexed tree (1D, 2D and 3D)
  • binary search tree
  • red-black tree

Algorithms

  • greatest common divisor
  • least common multiple
  • multiplication of integer numbers without overflow
  • modular multiplicative inverse
  • longest monotonic subsequence (all 4 versions)
  • fast Fibonacci numbers calculator
  • Knuth's prefix function
  • Manacher's algorithm for finding palindromic substrings
  • shortest text template
  • sieve of Eratosthenes
  • prime numbers generator
  • majority element

Graphs

  • graph class
  • bipartite graph class
  • depth first search
  • breadth first search
  • topological sort
  • finding connected components
  • finding strongly connected components (Tarjan's algorithm)
  • Kurskal's minimum spanning tree algorithm
  • Prim's minimum spanning tree algorithm (incoming improvements)
  • Dijkstra's algorithm for finding shortest paths
  • Floyd-Warshall algorithm for finding shortest paths
  • Edmonds-Karp algorithm for finding maximum flow
  • Dinic's algorithm for finding maximum flow
  • Hopcroft-Karp algorithm for finding maximum matching in bipartite graphs

Geometry

  • point class
  • line segment class
  • distance between two points
  • checking if 3 points are collinear
  • detecting if a point is on a line segment
  • detecting intersection of line segments
  • convex hull

Compile-time algorithms

  • greatest common divisor