CP-DSA Resources
Collection of some amazing resources to boost your CP journey!
Prerequisite
Learn a Language. Language preference order → C++ > Java > Python. Language does not matter much; you can choose your language based on your interests and prior experience. If you are entirely new, then go with C++.
C++ Resources
Java Resources
Java Tutorial in Hindi | Learn Java in One video for Beginners [2022] | Anuj Bhaiya Java🔥
Java OOPs Concepts in just 60 minutes | Object Oriented Programming | Java Tutorial For Beginners
Python
2. Set up your coding environment to tailor to CP/DSA.
How to setup VS code for DSA and CP | Input / Output split format
Competitive Programming Helper (cph) : Automate Input And Output Matching | VS Code Extension for CP
You can start giving contests anytime now!!! Start with div4/div3, Solve problems from Codechef with low ratings first so that you will understand how these platforms work. Then try out other platforms
3. Solve Pattern printing problems to familiarize yourself with loops and build logical thinking.
4. Learn about Space complexity and Time complexity.
5. Read about basic data structures and implement them.
6. Learn about the inbuilt data structure library corresponding to your language.
C++ Resources
C++ STL | Competitive Programming (Good Explanation with problems)
Python Resources
Modules
Collections(
Counter
,Deque
)
Where to Practice problems and give contests?
DSA Focused: Leetcode, GeeksForGeeks, Atcoder, Coding Ninjas
- CP+DSA Focused: Codeforces, Codechef, Atcoder, Leetcode
List of Important problems to cover for Interviews:
Striver SDE Sheet (If you have less time)
Road Map: (Not a Road Map but it makes you understand what topics to learn for CP and how to practice)
Topic wise Playlists:
STL(for C++):
C++ STL | Competitive Programming (Good Explanation with problems)
Sorting Algorithms:
Two Pointers and Sliding Window: (IMP for Interviews)
Binary Search: (IMP for Interviews)
Binary Search on answer: (Adv)
Advanced Recursion and Backtracking: (IMP for Interviews)
Number Theory and Math:
CodeNcode (For CP)
Chinese Remainder Theorem (For CP)
Linear Diophantine equations (Only For Adv CP)
Bit Manipulation
Data Structures
You can learn Data Structures like stack, queue, set, maps, and deque from your respective language libraries by searching on GFG website or from the 6th prerequisite (for C++ it will be completed in the STL or you can follow stack)
- Priority Queue
- Tries
- DSU (Adv)
- Segment Trees (Adv)
- Ordered Set (C++)
- Sparse Table
- Fenwick Trees (BIT) (Adv)
Dynamic Programming (IMP for Interviews)
Binary Trees (IMP for Interviews and only for DSA)
Graphs and Trees (IMP for Interviews)
Advanced Topics: (Only for CP)
- Digit DP
DP on Trees
String Algorithms: (KMP, Z, manacher, String hashing)
- Pepcoding (has many range of topics, only learn KMP, Z, Manacher, String Hashing) problems from CSES.
Game Theory:
- Pepcoding (Adv)
Matrix Exponentiation: (Adv)
Useful Techniques:
Difference array (easy)
Kadane’s Algorithm (easy)
Sweep Line (Medium)
Small to Large merge in trees (Adv, CP)
Cycles in Permutation (Adv, CP)
Other Useful resources:
CPalgorithms (The ultimate place to find explanations and code for many algorithms)
USACO (Complete guide for CP)
YouTube Channels for Post Contest Solutions
- TLE Eliminators (For CF, LC, CC)
- Vivek Gupta (For LC)
- Aryanc (For CF, CC, LC, AT)
- Coding Mohan
Debugging Template (C++)
Kenkooo (you can find a list of Atcoder contest problems)
Oies (For pattern recognition, don’t use it during a contest)
Atcoder DP contest (Really good problems on many variations of DP), solutions
Clist (To see upcoming contests and Leetcode ranks like all India ranks and others)
Extensions:
Sheets to practice:
Striver SDE Sheet (If you have less time)
C2 Ladders (For CP, contains 100 good problems from CF for every rating)
ACD Ladders (For CP, contains 100 good problems from CF for every rating, filter by tags is available)
Progvar (Only for CP, has very good old topic-wise Codeforces problems)
Competitions:
Facebook Hacker Cup
ICPC
TCS CodeVita
Youtube Channels to look out for:
- Striver
- Vivek Gupta
- Errichto
- Colin Galen (If you want to improve logical thinking and visualizing power do check his videos)
- Abdul Bari
- Second Thread (Adv)
- Erricto and Erricto Algorithms (Adv)
- CF step (Adv)
- Coding Mohan (Adv)
- Soumya Bhattacharjee (Adv)
Note:
Don’t jump into all the topics at once. Take some time and learn when it’s needed. (How will you know that you have to start learning a topic? Ans: Suppose you solved 3 problems in LC and not the 4th then start learning the topics on which the 4th question is based on).
Some playlists contain topics from beginner to advanced. So there is no need to complete all the videos from a Playlist. Take your time, and give a break if you don’t understand a topic.
You can find the topic-wise problems from playlists and you can also search problems based on tags in Leetcode, Codeforces, and Codechef.
General Advice:
- Must Upsolve after contest!!
- Do post contest discussion with friends.
- Create a healthy competition among peers.
- Take it as a marathon rather than a sprint.
- Practice practice and practice
- And don't forget to flex your achievements.
- Look at other people's code.
- Use editorials.