Algorithms and data structure used frequently in competitive programming.
C++
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
BFS.cpp
BellmanFord.cpp
BinarySearch.cpp
BinaryTreeTraversal.cpp
BitMasking.cpp
BubbleSort.cpp
CountInversions.cpp
DFS.cpp
Dijkstras.cpp
DisjointSets.cpp
EuclidGCD.cpp
FenwickTree.cpp
FloydWarshall.cpp
Heap.cpp
HeapSort.cpp
Heap_min_STL.cpp
InsertionSsort.cpp
KruskalsAlgorithm.cpp
LinearSearch.cpp
LinkedList.cpp
MergeSort.cpp
ModularExponentiation.cpp
PrimsAlgorithm.cpp
QuickSort.cpp
README.md
RabinKarp.cpp
SegmentTree.cpp
Segmented Sieve.cpp
Selection_sort.cpp
SieveOfEratosthenes.cpp
StronglyConnectedComponents.cpp
TopologicalSort.cpp
Trie.cpp

README.md

Here is the list of all the algorithms and data strucuture that are used frequently in competitive coding along with their C++ implementation.

Data Structures

  • Binary Indexed trees / Fenwick tree
  • Segment Tree
  • Heap
  • Sparse Table
  • Disjoint sets
  • Binary Trees Traversal
  • Red Black trees
  • Hashmaps
  • Elementary data strucuture -> Linkedlist, stack and queues

Graph Algorithms

  • Breadth First Search
  • Depth First Search
  • Topological Sorting
  • Strongly Connected Components
  • Dijkstra’s algorithm
  • Floyd Warshall algorithm
  • Bellman-Ford
  • Prim’s algorithm
  • Kruskal’s algorithm
  • Bipartite Checking
  • Detecting cycle in a Graph
  • Ford Fulkersen Algorithm
  • Minimum Cost Maximum Flow Algorithm
  • Min Cut Algorithm
  • Eulerian path (Hierholzer’s algorithm)
  • Tarjan’s algorithms for finding bridges and articulation points

Number Thoery and mathematics

  • Euclid Algorithm for GCD
  • Sieve of erasthonesis
  • Segmented Sieve
  • Modular exponentiation
  • Euler's Totient Function
  • Fermat's Theorem
  • Lucas Theorem
  • Addition/Subtraction/Multiplication of matrices
  • Solving system of linear equations
  • Chinease Remainder Theorem
  • Logarithmic Exponentiation

Searching and Sorting

  • Linear Search
  • Binary Search
  • Bubble Sort
  • Selection sort
  • Insertion sort
  • Merge Sort
  • Quick Sort
  • Heap Sort
  • Counting Sort
  • Count Inversions

String

  • Suffix Array
  • Knuth Morris Pratt Algorithm
  • Rabin Karp Algorithm
  • Tries
  • Suffix Tree
  • Prefix Array