Strivers A2Z DSA Course/Sheet

The course is made for people who want to learn DSA from A to Z for FREE from one of India’s top educators in DSA.

Made with love by takeUforward!

What is Strivers A2Z DSA Course/Sheet? 

This course is made for people who want to learn DSA from A to Z for free in a well-organized and structured manner. The lecture quality is better than what you get in paid courses, the only thing we don’t provide is doubt support, but trust me our YouTube video comments resolve that as well, we have a wonderful community of 250K+ people who engage in all of the videos.

There might be a lot of existing courses/sheets in the market, but this is better in terms of structure, and the number of questions we will be doing. We just don’t teach the basics, we cover all the varieties, and we go in super depth for each topic, so that you are well prepared for any of your interviews.

Disclaimer: If you know DSA, and you have limited time to prepare for interviews, we recommend you to do the crisp and handpicked Striver’s SDE Sheet, which is used by almost everyone who prepares for FAANG and other companies.

Why trust the course? 

This is a course/sheet which is prepared by Raj Vikramaditya A.K.A Striver, Candidate Master, 6*, who currently works at Google Warsaw. He had offers from Facebook London, and prior to this, he worked at Media.net(Directi). He has also interned at Amazon India. His channel takeUforward is currently India’s No.1 channel in the DSA niche when you talk about views generated every month.

Testimonials? 

We have had amazing reviews from people who work at Google, Amazon, Facebook, etc. You can check them on Striver’s Instagram or our Linkedin as well. So, what are you waiting for? Let’s start our journey to learn DSA today.

Note: If you find the course/sheet useful, you can also contribute an article or solution for any problem to be published on takeuforward.org! Click here for more details.

Step 1: Learn the basics
Step 1.1: Things to Know in C++/Java/Python or any language
Topic/Article GfG Solution Leetcode
User Input / Output
Data Types
If Else statements
Switch Statement
What are arrays, strings?
For loops
While loops
Functions (Pass by Reference and Value)
Time Complexity [Learn Basics, and then analyse in next Steps]
Step 1.2: Build-up Logical Thinking

Do all these patterns

Step 1.3: Learn STL/Java-Collections or similar thing in your language
Topic/Article Solution
C++ STL
Java Collections
Step 1.4: Know Basic Maths
Topic/Article GfG Solution Leetcode
Count Digits
Reverse a Number
Check Palindrome
GCD Or HCF
Armstrong Numbers
Print all Divisors
Check for Prime
Step 1.5: Learn Basic Recursion
Topic/Article GfG Solution Leetcode
Understand recursion by print something N times
Print name N times using recursion
Print 1 to N using recursion
Print N to 1 using recursion
Sum of first N numbers
Factorial of N numbers
Reverse an array
Check if a string is palindrome or not
Fibonacci Number
Step 1.6: Learn Basic Hashing
Topic/Article GfG Solution Leetcode
Counting frequencies of array elements
Find the highest/lowest frequency element
Step 2: Learn Important Sorting Techniques
Step 2.1: Sorting-I
Topic/Article GfG Video Leetcode
Selection Sort
Bubble Sort
Insertion Sort
Step 2.2: Sorting-II
Topic/Article GfG Video Leetcode
Merge Sort
Recursive Bubble Sort
Recursive Insertion Sort
Quick Sort
Step 3: Solve Problems on Arrays [Easy -> Medium -> Hard]
Step 3.1: Easy
Topic/Article GfG Solution Leetcode
Largest Element in an Array
Second Largest Element in an Array without sorting
Check if the array is sorted
Remove duplicates from Sorted array
Left Rotate an array by one place
Left rotate an array by D places
Move Zeros to end
Linear Search
Find the Union and intersection of two sorted arrays
Find missing number in an array
Maximum Consecutive Ones
Subarray with given sum
Find the Missing Number
Find the number that appears once, and other numbers twice.
Search an element in a 2D matrix
Find the row with maximum number of 1’s
Step 3.2: Medium
Topic/Article GfG Solution Leetcode
2Sum Problem  
Sort an array of 0’s 1’s and 2’s
Majority Element (>n/2 times)
Kadane’s Algorithm, maximum subarray sum
Print subarray with maximum subarray sum (extended version of above problem)
Stock Buy and Sell
Rearrange the array in alternating positive and negative items
Next Permutation
Leaders in an Array problem
Longest Consecutive Sequence in an Array
Set Matrix Zeros
Rotate Matrix by 90 degrees
Print the matrix in spiral manner
Step 3.3: Hard
Topic/Article GfG Solution Leetcode
Pascal’s Triangle
Majority Element (n/3 times)
3-Sum Problem
4-Sum Problem
Largest Subarray with 0 Sum
Count number of subarrays with given xor K
Merge Overlapping Subintervals
Merge two sorted arrays without extra space
Find the repeating and missing number
Count Inversions
Reverse Pairs
Maximum Product Subarray
Step 4: Binary Search [1D, 2D Arrays, Search Space]
Step 4.1: Learning BS on 1D Arrays
Topic/Article GfG Solution Leetcode
Binary Search to find X in sorted array
Implement Lower Bound
Implement Upper Bound
Search Insert Position
Check if Input array is sorted
Find the first or last occurrence of a given number in a sorted array
Count occurrences of a number in a sorted array with duplicates
Find peak element
Search in Rotated Sorted Array I
Search in Rotated Sorted Array II
Find minimum in Rotated Sorted Array
Single element in a Sorted Array
Find kth element of two sorted arrays
Find out how many times has an array been rotated
Step 4.2: Applying BS on 2D Arrays
Topic/Article GfG Solution Leetcode
Search in a 2 D matrix
Find Peak Element
Matrix Median
Step 4.3: Find Answers by BS in Search Space
Topic/Article GfG Solution Leetcode
Find square root of a number in log n
Find the Nth root of a number using binary search
Koko Eating Bananas
Minimum days to make M bouquets
Find the smallest Divisor
Capacity to Ship Packages within D Days
Median of two sorted arrays
Aggressive Cows
Book Allocation Problem
Split array – Largest Sum
Kth Missing Positive Number
Minimize Max Distance to Gas Station
Median of 2 sorted arrays
Kth element of 2 sorted arrays
Step 5: Strings [Basic and Medium]

  • String has extremely hard problems for beginners in its hard section, so it is covered in the later half
  • String has lesser problems, because most of the string problems have hard concepts like DP or others which are covered in different topics.

Step 5.1: Basic and Easy String Problems
Topic/Article GfG Solution Leetcode
Remove outermost Paranthesis
Reverse words in a given string / Palindrome Check
Largest odd number in a string
Longest Common Prefix
Isomorphic String
check whether one string is a rotation of another
Check if two strings are anagram of each other
Step 5.2: Medium String Problems
Topic/Article GfG Solution Leetcode
Sort Characters by frequency
Maximum Nesting Depth of Paranthesis
Roman Number to Integer and vice versa
Implement Atoi
Count Number of Substrings
Longest Palindromic Substring[Do it without DP]
Sum of Beauty of all substring
Reverse Every Word in A String
Step 6: Learn LinkedList [Single/Double LL, Medium, Hard]
Step 6.1: Learn 1D LinkedList
Topic/Article GfG Solution Leetcode
Introduction to LinkedList, learn about struct, and how is node represented
Inserting a node in LinkedList
Deleting a node in LinkedList
Find the length of the linkedlist [learn traversal]
Search an element in the LL
Step 6.2: Learn Doubly LinkedList
Topic/Article GfG Solution Leetcode
Introduction to DLL, learn about struct, and how is node represented
Insert a node in DLL
Delete a node in DLL
Reverse a DLL
Step 6.3: Medium Problems of LL
Topic/Article GfG Solution Leetcode
Middle of a LinkedList [TortoiseHare Method]
Reverse a LinkedList [Iterative]
Reverse a LL [Recursive]
Detect a loop in LL
Find the starting point in LL
Length of Loop in LL
Check if LL is palindrome or not
Segrregate odd and even nodes in LL
Remove Nth node from the back of the LL
Delete the middle node of LL
Sort LL
Sort a LL of 0’s 1’s and 2’s by changing links
Find the intersection point of Y LL
Add 1 to a number represented by LL
Add 2 numbers in LL
Step 6.4: Medium Problems of DLL
Topic/Article GfG Solution Leetcode
Delete all occurrences of a key in DLL
Find pairs with given sum in DLL
Remove duplicates from sorted DLL
Step 6.5: Hard Problems of LL
Topic/Article GfG Solution Leetcode
Reverse LL in group of given size K
Rotate a LL
Flattening of LL
Clone a Linked List with random and next pointer
Step 7: Recursion [PatternWise]
  • Please complete the basic recursion questions in Step 1
  • To learn completely recursion, watch this playlist -> Link
Step 7.1: Get a Strong Hold
Topic/Article GfG Solution Leetcode
Recursive Implementation of atoi()
Pow(x, n)
Count Good numbers
Sort a stack using recursion
Reverse a stack using recursion
Step 7.2: Subsequences Pattern
Topic/Article GfG Solution Leetcode
Generate all binary strings
Generate Paranthesis
Print all subsequences/Power Set
Learn All Patterns of Subsequences (Theory)
Count all subsequences with sum K
Check if there exists a subsequence with sum K
Combination Sum
Combination Sum-II
Subset Sum-I
Subset Sum-II
Combination Sum – III
Letter Combinations of a Phone number
Step 7.3: Trying out all Combos / Hard
Topic/Article GfG Solution Leetcode
Palindrome Partitioning
Word Search
N Queen
Rat in a Maze
Word Break
M Coloring Problem
Sudoko Solver
Expression Add Operators
Step 8: Bit Manipulation [Concepts & Problems] & Advanced Maths

  • It is one of the smallest topics in DSA, learn the basic concepts.
  • There are only few problems which are repeatedly asked in Interviews which have been added.

Step 8.1: Learn Bit Manipulation
Topic/Article GfG Solution Leetcode
Introduction to Bit Manipulation [Theory]
Check if the i-th bit is set or not
Check if a number is odd or not
Check if a number is power of 2 or not
Count the number of set bits
Set/Unset the rightmost unset bit
Swap two numbers
Divide two integers without using multiplication, division and mod operator
Step 8.2: Interview Problems
Topic/Article GfG Solution Leetcode
Count number of bits to be flipped to convert A to B
Find the number that appears odd number of times
Power Set
Fnd xor of numbers from L to R
Find the two numbers appearing odd number of times
Step 8.3: Advanced Maths
Topic/Article GfG Solution Leetcode
Print Prime Factors of a Number
All Divisors of a Number
Sieve of Eratosthenes
Find Prime Factorisation of a Number using Sieve
Power(n, x)
Step 9: Stack and Queues [Pre-In-Post-fix, Monotonic Stack]
Step 9.1: Learning
Topic/Article GfG Solution Leetcode
Implement Stack using Arrays
Implement Queue using Arrays
Implement Stack using Queue
Implement Queue using Stack
Implement stack using Linkedlist
Implement queue using Linkedlist
Check for balanced paranthesis
Implement Min Stack
Step 9.2: Prefix, Infix, PostFix Conversion Problems
Topic/Article GfG Solution Leetcode
Infix to Postfix Conversion using Stack
Prefix to Infix Conversion
Prefix to Postfix Conversion
Postfix to Prefix Conversion
Postfix to Infix
Convert Infix To Prefix Notation
Step 9.3: Monotonic Stack/Queue Problems [VVV. Imp]
Topic/Article GfG Solution Leetcode
Next Greater Element
Next Greater Element 2
Next Smaller Element
Number of NGEs to the right
Trapping Rainwater
Sum of subarray minimum
Stock span problem
Asteroid Collision
Sum of subarray ranges
Remove k Digits
Largest rectangle in a histogram
Maximal Rectangles
Step 9.4: Implementation Problems
Topic/Article GfG Solution Leetcode
Sliding Window maximum
Stock Span Problem
The Celebrity Problem
Rotten Oranges
LRU cache (IMPORTANT)
LFU cache
Step 10: Sliding Window & Two Pointer Combined Problems
Step 10.1: Medium Problems
Topic/Article GfG Solution Leetcode
Longest Substring Without Repeating Characters
Max Consecutive Ones III
Fruit Into Baskets
longest repeating character replacement
Binary subarray with sum
Count number of nice subarrays
Number of substring containing all three characters
Maximum point you can obtain from cards
Step 10.2: Hard Problems
Topic/Article GfG Solution Leetcode
Longest Substring with At Most K Distinct Characters
Subarray with k different integers
Minimum Window Substring
Minimum Window Subsequence Problem 2
Step 11: Heaps [Learning, Medium, Hard Problems]
Step 11.1: Learning
Topic/Article GfG Solution Leetcode
Introduction to Priority Queues using Binary Heaps
Min Heap and Max Heap Implementation
Check if an array represents a min-heap or not
Convert min Heap to max Heap
Step 11.2: Medium Problems
Topic/Article GfG Solution Leetcode
Kth largest element in an array [use priority queue]
Kth smallest element in an array [use priority queue]
Sort K sorted array
Merge M sorted Lists
Replace each array element by its corresponding rank
Task Scheduler
Hands of Straights
Step 11.3: Hard Problems
Topic/Article GfG Solution Leetcode
Design twitter
Connect `n` ropes with minimal cost
Kth largest element in a stream of running integers
Maximum Sum Combination
Find Median from Data Stream
K most frequent elements
Step 12: Greedy Algorithms [Easy, Medium/Hard]
Step 12.1: Easy Problems
Topic/Article GfG Solution Leetcode
Assign Cookies
Fractional Knapsack Problem
Greedy algorithm to find minimum number of coins
Lemonade Change
Valid Paranthesis Checker
Step 12.2: Medium/Hard
Topic/Article GfG Solution Leetcode
N meetings in one room
Jump Game
Jump Game 2
Minimum number of platforms required for a railway
Job sequencing Problem
Candy
Program for Shortest Job First (or SJF) CPU Scheduling
Program for Least Recently Used (LRU) Page Replacement Algorithm
Insert Interval
Merge Intervals
Non-overlapping Intervals
Step 13: Binary Trees [Traversals, Medium and Hard Problems]
  • An entire playlist is made on it, it is more than enough
Step 13.1: Traversals
Topic/Article GfG Solution Leetcode
Introduction to Trees
Binary Tree Representation in C++
Binary Tree Representation in Java
Binary Tree Traversals in Binary Tree  
Preorder Traversal of Binary Tree
Inorder Traversal of Binary Tree
Post-order Traversal of Binary Tree
Level order Traversal / Level order traversal in spiral form
Iterative Preorder Traversal of Binary Tree
Iterative Inorder Traversal of Binary Tree
Post-order Traversal of Binary Tree using 2 stack
Post-order Traversal of Binary Tree using 1 stack
Preorder, Inorder, and Postorder Traversal in one Traversal

Step 13.2: Medium Problems
Topic/Article GfG Solution Leetcode
Height of a Binary Tree
Check if the Binary tree is height-balanced or not
Diameter of Binary Tree
Maximum path sum
Check if two trees are identical or not
Zig Zag Traversal of Binary Tree
Boundary Traversal of Binary Tree
Vertical Order Traversal of Binary Tree
Top View of Binary Tree
Bottom View of Binary Tree
Right/Left View of Binary Tree
Symmetric Binary Tree
Step 13.1: Hard Problems
Topic/Article GfG Solution Leetcode
Root to Node Path in Binary Tree
LCA in Binary Tree
Maximum width of a Binary Tree
Check for Children Sum Property
Print all the Nodes at a distance of K in a Binary Tree
Minimum time taken to BURN the Binary Tree from a Node
Count total Nodes in a COMPLETE Binary Tree
Requirements needed to construct a Unique Binary Tree | Theory Link
Construct Binary Tree from inorder and preorder
Construct the Binary Tree from Postorder and Inorder Traversal
Serialize and deserialize Binary Tree
Morris Preorder Traversal of a Binary Tree
Morris Inorder Traversal of a Binary Tree
Flatten Binary Tree to LinkedList
Step 14: Binary Search Trees [Concept and Problems]
  • An entire playlist is made on it, it is more than enough
Step 14.1: Concepts
Topic/Article GfG Solution Leetcode
Introduction to Binary Search Tree
Search in a Binary Search Tree
Find Min/Max in BST
Step 14.2: Practice Problems
Topic/Article GfG Solution Leetcode
Ceil in a Binary Search Tree
Floor in a Binary Search Tree
Insert a given Node in Binary Search Tree
Delete a Node in Binary Search Tree
Find K-th smallest/largest element in BST
Check if a tree is a BST or BT
LCA in Binary Search Tree
Construct a BST from a preorder traversal
Inorder Successor/Predecessor in BST
Merge 2 BST’s
Two Sum In BST | Check if there exists a pair with Sum K
Recover BST | Correct BST with two nodes swapped
Largest BST in Binary Tree
Step 15: Graphs [Concepts & Problems]

  • The new Graph playlist is under progress, you can check here -> Link
  • In case you have lesser time, you can check the old graph series here -> Link

Step 15.1: Learning
Topic/Article GfG Solution Leetcode
Graph and Types
Graph Representation | C++
Graph Representation | Java
Connected Components | Logic Explanation
BFS
DFS
Step 15.2: Problems on BFS/DFS
Topic/Article GfG Solution Leetcode
Number of provinces (leetcode)
Connected Components Problem in Matrix
Rotten Oranges
Flood fill
Cycle Detection in unirected Graph (bfs)
Cycle Detection in undirected Graph (dfs)
0/1 Matrix (Bfs Problem)
Surrounded Regions (dfs)
Number of Enclaves [flood fill implementation – multisource]
Word ladder – 1
Word ladder – 2
Number of Distinct Islands [dfs multisource]
Bipartite Graph (DFS)
Cycle Detection in Directed Graph (DFS)
Step 15.3: Topo Sort and Problems
Topic/Article GfG Solution Leetcode
Topo Sort
Kahn’s Algorithm
Cycle Detection in Directed Graph (BFS)
Course Schedule – I
Course Schedule – II
Find eventual safe states
Alien dictionary
Step 15.4: Shortest Path Algorithms and Problems
Topic/Article GfG Solution Leetcode
Shortest Path in UG with unit weights
Shortest Path in DAG
Djisktra’s Algorithm
Why priority Queue is used in Djisktra’s Algorithm
Shortest path in a binary maze
Path with minimum effort
Cheapest flights within k stops
Network Delay time
Number of ways to arrive at destination
Minimum steps to reach end from start by performing multiplication and mod operations with array elements
Bellman Ford Algorithm
Floyd Warshal Algorithm
Find the city with the smallest number of neighbors in a threshold distance
Step 15.5: MinimumSpanningTree/Disjoint Set and Problems
Topic/Article GfG Solution Leetcode
Minimum Spanning Tree
Prim’s Algorithm
Disjoint Set [Union by Rank]
Disjoint Set [Union by Size]
Kruskal’s Algorithm
Number of operations to make network connected
Most stones removed with same rows or columns
Accounts merge
Number of island II
Making a Large Island
Swim in rising water [HARD]
Step 15.6: Other Algorithms
Topic/Article GfG Solution Leetcode
Bridges in Graph
Articulation Point
Kosaraju’s Algorithm
Step 16: Dynamic Programming [Patterns and Problems]
  • An entire playlist is made on it, it is more than enough
Step 16.1: Introduction to DP
Topic/Article GfG Solution Leetcode
Dynamic Programming Introduction
Step 16.2: 1D DP
Topic/Article GfG Solution Leetcode
Climbing Stars
Frog Jump(DP-3)
Frog Jump with k distances(DP-4)
Maximum sum of non-adjacent elements (DP 5)
House Robber (DP 6)
Step 16.3: 2D/3D DP and DP on Grids
Topic/Article GfG Solution Leetcode
Ninja’s Training (DP 7)
Grid Unique Paths : DP on Grids (DP8)
Grid Unique Paths 2 (DP 9)
Minimum path sum in Grid (DP 10)
Minimum path sum in Triangular Grid (DP 11)
Minimum/Maximum Falling Path Sum (DP-12)
3-d DP : Ninja and his friends (DP-13)
Step 16.4: DP on Subsequences
Topic/Article GfG Solution Leetcode
Subset sum equal to target (DP- 14)
Partition Equal Subset Sum (DP- 15)
Partition Set Into 2 Subsets With Min Absolute Sum Diff (DP- 16)
Count Subsets with Sum K (DP – 17)
Count Partitions with Given Difference (DP – 18)
0/1 Knapsack (DP – 19)
Minimum Coins (DP – 20)
Target Sum (DP – 21)
Coin Change 2 (DP – 22)
Unbounded Knapsack (DP – 23)
Rod Cutting Problem | (DP – 24)
Step 16.5: DP on Strings
Topic/Article GfG Solution Leetcode
Longest Common Subsequence | (DP – 25)
Print Longest Common Subsequence | (DP – 26)
Longest Common Substring | (DP – 27)
Longest Palindromic Subsequence | (DP-28)
Minimum insertions to make string palindrome | DP-29
Minimum Insertions/Deletions to Convert String | (DP- 30)
Shortest Common Supersequence | (DP – 31)
Distinct Subsequences| (DP-32)
Edit Distance | (DP-33)
Wildcard Matching | (DP-34)
Step 16.6: DP on Stocks
Topic/Article GfG Solution Leetcode
Best Time to Buy and Sell Stock |(DP-35)
Buy and Sell Stock – II|(DP-36)
Buy and Sell Stocks III|(DP-37)
Buy and Stock Sell IV |(DP-38)
Buy and Sell Stocks With Cooldown|(DP-39)
Buy and Sell Stocks With Transaction Fee|(DP-40)
Step 16.7: DP on LIS
Topic/Article GfG Solution Leetcode
Longest Increasing Subsequence |(DP-41)
Printing Longest Increasing Subsequence|(DP-42)
Longest Increasing Subsequence |(DP-43)
Largest Divisible Subset|(DP-44)
Longest String Chain|(DP-45)
Longest Bitonic Subsequence |(DP-46)
Number of Longest Increasing Subsequences|(DP-47)
Step 16.8: MCM DP | Partition DP
Topic/Article GfG Solution Leetcode
Matrix Chain Multiplication|(DP-48)
Matrix Chain Multiplication | Bottom-Up|(DP-49)
Minimum Cost to Cut the Stick|(DP-50)
Burst Balloons|(DP-51)
Evaluate Boolean Expression to True|(DP-52)
Palindrome Partitioning – II|(DP-53)
Partition Array for Maximum Sum|(DP-54)
Step 16.9: DP on Squares
Topic/Article GfG Solution Leetcode
Maximum Rectangle Area with all 1’s|(DP-55)
Count Square Submatrices with All Ones|(DP-56)
Step 17: Tries [Concepts and Problems]

  • Trie has limited problems, and usually they ask directly.
  • An entire playlist is made on it, you don’t need anything out of what is given below.

Step 17.1: Theory
Topic/Article GfG Solution Leetcode
Implement TRIE | INSERT | SEARCH | STARTSWITH
Step 17.2: Problems
Topic/Article GfG Solution Leetcode
Implement Trie – 2 (Prefix Tree)
Longest String with All Prefixes
Number of Distinct Substrings in a String
Bit PreRequisites for TRIE Problems
Maximum XOR of two numbers in an array
Maximum XOR With an Element From Array
Step 18: Strings [Hard Problems and Standard Algos]

  • Basic, Medium, and other concepts on Strings have been covered above.
  • In this we cover the algorithms, and applications which are generally asked, it is slightly tough to understand intuition wise, so don’t be much concerned.

Step 18.1: Hard Problems
Topic/Article GfG Solution Leetcode
Minimum number of bracket reversals needed to make an expression balanced
Count and say
Hashing In Strings | Theory
Rabin Karp
Z-Function
KMP algo / LPS(pi) array
Shortest Palindrome
Longest happy prefix
Count palindromic subsequence in given string
Step 19: Request from Striver

If this Course/Sheet helped you in any possible way, you can always help me by doing any of the followings. It won’t cost you anything, eveything is free, but yes, I will be able to reach more and more people by word of mouth.

  • You can tag me on Linkedin/Twitter/Instagram and give a shoutout for the content. In case you do so, please do use #StriversA2ZDSA so that I can easily track them all down always.
  • You can share it on Whatsapp as well, by clicking here.
  • When you start the Course/Sheet you can comment on the launch video, and when you end, you can comment your end date, experience, mistakes, so that the juniors of the next generation don’t repeat them πŸ™‚
  • If you are willing to pay or donate any money, feel free to donate to any of the nearby organisations, I will be super happy. We don’t need money as of now. By God’s grace we are happy and doing well.

Hurrah!! You are ready for your placement after some months of hard work! All the best, keep striving… 

Striver

Share the course/sheet with your friends, created with love for takeUforward fam!

If you find any mistakes in the sheet, it can be a wrong link as well, please fill out the google form here, our team will check it on a weekly basis, thanks.