COMPETITIVE PROGRAMMING AND
DATA STRUCTURES & ALGORITHMS
Prerequisite
1. 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
● C++ Basics in One Shot - Strivers A2Z DSA Course - L1
Java Resources
● Java Tutorial in Hindi | Learn Java in One video for Beginners [2022] | Anuj Bha…
● Java OOPs Concepts in just 60 minutes | Object Oriented Programming | Java …
Python
● Python Tutorial for Beginners | Learn Python in 1.5 Hours
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 Co…
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.
Resources
● Solve any Pattern Question - Trick Explained | 22 Patterns in 1 Shot | Strivers …
4. Learn about Space complexity and Time complexity.
Resources
● Time and Space Complexity - Strivers A2Z DSA Course
5. Read about basic data structures and implement them.
● Arrays
● Linked List
● Stack
● Queue
● Deque
● Set
● Map
6. Learn about the inbuilt data structure library corresponding to your language.
C++ Resources
● Complete C++ STL in 1 Video | Time Complexity and Notes
● C++ STL | Competitive Programming (Good Explanation with problems)
Java Resources
● Complete Java Collections Framework in 1 Video - Java Collections Framework
Python
● List Comprehension - Python Quick Tips
● Intermediate Python Tutorial #3 - Map() Function
● Modules
○ Math
○ Collections(Counter,Deque)
○ Bisect
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 A2Z Sheet
● 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)
● Colin Galen’s Road Map
Topic wise Playlists:
STL(for C++):
● C++ STL | Competitive Programming (Good Explanation with problems)
● Complete C++ STL in 1 Video | Time Complexity and Notes
Sorting Algorithms:
● Stiver’s part-1, Merge-sort, Quick Sort
Two Pointers and Sliding Window: (IMP for Interviews)
● Aditya Verma’s Sliding Window
● Stiver’s Two pointers and Sliding Window
Binary Search: (IMP for Interviews)
● Aditya Verma’s BS
● Stiver’s Binary Search
● Binary Search on answer: (Adv)
→ ACD
Advanced Recursion and Backtracking: (IMP for Interviews)
● Striver’s Recursion and Backtracking
Number Theory and Math:
● Luv Kumar’s Math & Bit Manipulation
● Combinatorics, Expected value, Probability
● CodeNcode (For CP)
● Chinese Remainder Theorem (For CP)
● Linear Diophantine equations (Only For Adv CP)
Bit Manipulation
● Striver’s 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)
1. Priority Queue
● GFG
2. Tries
● Striver’s Tries
3. DSU (Adv)
● Vivek Gupta’s DSU
4. Segment Trees (Adv)
● Pepcoding
5. Ordered Set (C++)
● Priyansh Agarwal
6. Sparse Table
● Sparse Table
7. Fenwick Trees (BIT trees) (Adv)
● P1, P2
Dynamic Programming (IMP for Interviews)
● Striver’s DP Playlist
● Vivek Gupta’s DP Workshop
Binary Trees (IMP for Interviews and only for DSA)
● Striver’s Binary Trees
Graphs and Trees (IMP for Interviews)
● Striver’s Graph Playlist Complete
● Stiver’s Graph Playlist for people who have limited Time
Advanced Topics: (Only for CP)
→ Binary Lifting, LCA
→ Euler Tour:
● Priyansh
● pepcoding
Advanced topics for Dynamic Programming (Mostly for CP, but seen in Leetcode too)
1. DP with bitmasking
● Kartik Arora
2. Digit DP
● Kartik Arora
3. DP on Trees
● Kartik Arora
● Tree Rerooting
String Algorithms: (KMP, Z, manacher, String hashing)
● Pepcoding (has many range of topics, only learn KMP, Z, Manacher, String Hashing)
problem from CSES
Matrix Exponentiation: (Adv)
Theory:
● Erricto
Problems:
● p1, p2
Useful Techniques:
● Difference array (easy)
● Kadane’s Algorithm (easy)
● Sweep Line (Medium)
● Small to Large merge in trees (Adv, CP)
Other Useful resources:
1. CPalgorithms (The ultimate place to find explanations and code for many algorithms)
2. YouTube Channels for Post Contest Solutions
● TLE Eliminators (For CF, LC, CC)
● Vivek Gupta (For LC)
● Aryanc (For CF, CC, LC, AT)
● Coding Mohan
3. Debugging Template (C++)
4. Kenkooo (you can find a list of Atcoder contest problems)
5. Oies (For pattern recognition, don’t use it during a contest)
6. Atcoder DP contest (Really good problems on many variations of DP), solutions
7. Clist (To see upcoming contests and Leetcode ranks like all India ranks and others)
8. Extensions:
● CF, CF Timer Extension
● LC Timer Extension
Sheets to practice:
1. Striver A2Z Sheet
2. Striver SDE Sheet (If you have less time)
3. CSES problem set
4. C2 Ladders (For CP, contains 100 good problems from CF for every rating)
5. ACD Ladders (For CP, contains 100 good problems from CF for every rating, filter by tags is
available)
6. Progvar (Only for CP, has very good old topic-wise Codeforces problems)
7. Neetcode Blind 75
Competitions:
1. Facebook Hacker Cup
2. ICPC
3. 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:
1. Must Upsolve after contest!!
2. Do post contest discussion with friends.
3. Create a healthy competition among peers.
4. Take it as a marathon rather than a sprint.
5. Practice practice and practice
6. And don't forget to flex your achievements.
7. Look at other people's code.
8. Use editorials.