Theme | Introduction | Implementation |
---|---|---|
Sorting and Shuffling | Sorting and shuffling | Implementation.cpp |
Searching | Searching | Searching.cpp |
Recursion and backtracking | Recursive algorithms and backtracking | Implementation.cpp |
Combinatorics algorithms | Combinatorics algorithms | Implementation.cpp |
Trie | Prefix Trie | Implementation.cpp |
Trie | Autocomplete Trie | Implementation.cpp |
Binary Heap | Binary Heap | Implementation.cpp |
2D Tree | 2D Tree | Implementation.cpp |
KD-Tree | KD Tree | Implementation.cpp |
Hash-Table | Hash-Table using Lists | Implementation.cpp |
Dijkstra's algorithm | Dijkstra's algorithm | Implementation.cpp Examples.md |
Bellman-Ford algorithm | Bellman–Ford algorithm | Implementation.cpp |
Graham scan | Graham scan | Implementation.cpp |
N | Algorithm | About | Time complexity | Statement | Solution |
---|---|---|---|---|---|
1.01 | Finding bridges in a graph | graphs, dfs trees, back edges | O(N+M) | Critical edges | Solution.cpp Debug.cpp Debug.gif Examples (exploring).cpp |
1.02 | Finding articulation points in a graph | graphs, dfs trees, back edges | O(N+M) | Submerge Articulation Points and Bridges (Challenge) |
Solution (Submerge).cpp Art. Pts. & Bridges (Solution 1).cpp Art. Pts. & Bridges (Solution 2).cpp |
1.03 | Directing edges to form a strongly connected digraph | dfs and similar, graphs | O(N+M) | Bertown roads | Solution.cpp |
1.04 | Cactus (Hard) | data structures, dfs and similar, dp, graphs, trees | O(N.log(N) + Q) | E. Cactus | Analysis Solution 1.cpp Solution 2.cpp |
2.01 | Range Minimum Query (RMQ) | arrays, sparse tables | O(N.log(N)) preprocessing, O(1) for each query | RMQSQ - Range Minimum Query RPLN - Negative Score |
Solution (RMQSQ).cpp Solution (RPLN).cpp |
2.02 | Range Maximum Query (RMQ) | arrays, sparse tables | O(N.log(N)) preprocessing, O(1) for each query | THRBL - Catapult that ball | Solution.cpp |
2.03 | Range Min & Max Query | arrays, sparse-tables | O(N.log(N)) preprocessing, O(1) for each query | Matchsticks | Solution.cpp |
2.04 | RMQ, bs on answer with O(1) validation func | binary search, binary search on answer, sparse tables | O(N.log(N)) building ST, O(log N) per RQ | Sereja and D | Solution.cpp Editorial |
2.05 | Count of intervals with GCD=x | brute force, data structures, math | O(N.log^2(N)) preprocessing, O(1) for each query | CGCDSSQ | Solution algorithm design and analysis Solution 1 (sparse table).cpp Solution 2 (hash table).cpp |
2.06 | Droid Army (Multiple Sparse Tables) | binary search, data structures, two pointers | O(M.N.log(N)) | D. R2D2 and Droid Army | Solution.cpp |
2.07 | K Subsegments of Sequence | implementation | O(N.log(N)) or O(N) | Maximum of Maximums of Minimums | Solution 1 O(n.log(n)).cpp Solution 2 O(n).cpp Analysis |
2.08 | Range Minimal Index Query (RMIQ) | data structures | O(N.log(N)) | TNVFC1M - Miraculous | Solution.cpp |
2.09 | Multiplication Interval (Hard) | Segment Tree, Interval Tree, Sparse Table | O(N.log(N)) | DCP-19: Multiplication Interval | Solution.cpp |
2.10 | 2D RMQ | data structures, binary search | O(N.M.log(N).log(M)) preprocessing, O(log(N)) for each query | D. Animals and Puzzle | 2D RMQ Theory Solution.cpp |
3.01 | Lowest Common Ancestor (LCA) | trees, lca | O(N.log(N)) preprocessing, O(1) for each query | Algorithm LCA - Lowest Common Ancestor |
Solution.cpp |