A collection of Competitive Coding C++ Snippets created by Dhruvam Kothari and Mrunank Mistry.
The repository is a collection of C++ utility functions and classes which come handy in Competitive Coding.
│ .gitignore
│ CMakeLists.txt
│ LICENSE
│ README.md
│
├───.github
│ └───workflows
│ cmake.yml
│
├───Advanced-Data-Structures
│ ├───2D Prefix sums
│ │ prefix_sum_2d.cpp
│ │
│ ├───Fenwick Trees
│ │ count_inversions.cpp
│ │ fenwick_PQRU.cpp
│ │ fenwick_PURQ.cpp
│ │ fenwick_PURQ_0based.cpp
│ │
│ ├───Segment Trees
│ │ min_segment_tree.cpp
│ │ sum_segment_tree.cpp
│ │
│ └───Sparse Tables
│ sparse_table.cpp
│
├───Graphs
│ ├───Directed
│ │ │ cycle_detect_directed.cpp
│ │ │ Dijkstras.cpp
│ │ │
│ │ ├───Binary-Lifting
│ │ │ kth_ancestor.cpp
│ │ │
│ │ ├───Eulerian Graph
│ │ │ eulerian_directed_map.cpp
│ │ │ eulerian_directed_vectors.cpp
│ │ │
│ │ ├───Kahns Algo
│ │ │ kahns_algo.cpp
│ │ │
│ │ └───Kosaraju SCC
│ │ kosaraju_scc.cpp
│ │ kosaraju_scc_example_in_code.jpeg
│ │
│ └───Undirected
│ ├───DSU
│ │ dsu.cpp
│ │
│ └───Eulerian graph
│ eulerian_undirected.cpp
│
├───Number-Theory
│ binary_exp.cpp
│ factorization.cpp
│ modular_inverse.cpp
│ prime_sieve.cpp
│ sieve_factorization.cpp
│
├───Sliding-Window
│ sliding_window_max.cpp
│ sliding_window_min.cpp
│
├───Strings
│ ├───KMP
│ │ CP_ALGOS_EXPLANATION.md
│ │ CP_ALGOS_EXPLANATION.pdf
│ │ KMP.cpp
│ │
│ └───z-function
│ zfunc.cpp
│
└───Trees
├───Rooting A Tree
│ rooting_tree.cpp
│
└───Tries
Tries.cpp
- You need to install Cpp 17 compiler and CMake.
- If you are using Visual Studio Code, use the C/C++ Extension Pack.
Read the docstrings for each class/function/method. Also checkout the main function for each file which demonstrates the usage.
The repository is licensed under Apache License .
- Fork it (https://github.com/fork52/CP-ALGOS-DS/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request