Guide To Competitive Programming
Guide To Competitive Programming
It's advice to switch to CPP to avoid TLE issues at Codeforces and some platforms..
Learn C++ STL from codeverse or takeUforward channel ..
After Recursion:
1. Meet in the middle algorithm and problems related to it. (Follow CSES for problems)
2.Divide and conquer problems{highly recommended to use codeforces only for this}
3. Next greater element and next smaller element using stack (TakeUforward)
4. problems related to parenthesis.
5.largest rectangular area in histogram. (concept is used in a lot of problems)
(TakeUforward)
6.Problems related to Heap(Priority Queue) {although this gets under the greedy category
but by priority queue will help you learn an inbuilt stl)
String algorithms: (Since these are advanced topics, you can read them from where you feel
comfortable)
1. Rolling Hash Function on strings {cpalgorithms has a wonderful article written on it) {Spoj
or codeforces}
2.Rabin Karp Algorithm (cpalgorithms has a wonderful blog on it)
3.Prefix Function (cpalgorithms)
4.KMP Algorithm
5.Z-function
6.Manchers' Algorithm (once you have wrapped up the above algorithms, solve a bunch of
problems(25-30) on them from different platforms.)
Tree Algorithm :
1.Tree/Graph representation
2.DFS/BFS Traversal in Graph/Tree
3.Basic stuffs(diameter of tree, height of tree, level of tree)
4.Euler Tour of Tree(Learn and solve problems)
5.Finding LCA using Euler Tour{efficient solution uses segment trees)
6.Finding LCA using Binary Lifting. 7.Distance between two nodes.
8.Subtree Problems. (SPOJ is highly recommended for trees and codeforces D and E
problems also)
Dynamic Programming:
0. Solve all Standard problems on DP from GFG.. (Refer Aditya Verma youtube channel for
learning standard DP)
1.Solve the AtCoder Educational Contests on Dynamic Programming.(all 26)
2.Solve problems from SPOJ(highly recommended,since it doesn’t involve any other
algorithms)
3. Google dynamic programming practice problem codeforces,u’ll get a wonderful blog with a
lot of problems on it.
4.Understand how we write recurrence for Digit DP(codeforces blog)(digit dynamic progg)
and solve problems
5. read about DP with Bitmasks and solve problems(hackerearth blog)
6.DP on trees(gfg articles,rachit jains video)
7.SOS DP(cpalgorithm blog)
1.Disjoint Set(cpalgorithms)
2.Offline Queries using Disjoint Set
3.Kruskal’s Algorithm using disjoint set