6/4/26, 12:06 PM DSA Tutorial - GeeksforGeeks
Search... Courses Tutorials Practice Jobs S
DSA Tutorial Interview Questions Quizzes Must Do Advanced DSA System Design Aptitude Puzzles Interview Corner DSA Python
Share Your Experiences
DSA Fundamentals DSA Tutorial Fresher Jobs Experienced Jobs
Data Structures Last Updated : 20 May, 2026
Python Developer
DSA stands for Data Structures and Algorithms. Data Keylogic Infotech Private Limited
Algorithms Upto 1 Years • Onsite - Surat (Gujarat)
structures manage how data is stored and accessed. Apply by Sun Jun 07 2026
Advanced
Algorithms focus on processing this data. Examples of data
Application Support…
Interview Preparation structures are Array, Linked List, Tree and Heap, and Aress Software
Fresher • Onsite - Nashik (Maharashtra)
examples of algorithms are Binary Search, Quick Sort and Apply by Sun Jun 07 2026
Courses Merge Sort.
iOS Engineer
Summer SkillUp Explore Foundation for almost every software like GPS, Search Keylogic Infotech Private Limited
Upto 2 Years • Onsite - Surat (Gujarat)
Engines, AI ChatBots, Gaming Apps, Databases, Web Apply by Mon Jun 08 2026
Applications, etc
View All →
Top Companies like Google, Microsoft, Amazon, Apple,
Meta and many other heavily focus on DSA in
interviews. Upcoming Courses
Learning DSA boosts your problem-solving abilities and
make you a stronger programmer. VLSI Trainee Program
Starting from - June 1, 2026 4.6
• LIVE
Step by Step Learning MERN Full Stack…
Starting from - June 6, 2026 4.7
It is advised to skip the hard problems of every section in • LIVE
the first iteration if you are a complete beginner. Java Backend…
Starting from - June 6, 2026 4.6
• LIVE
Fundamentals
View All →
Programming : Input and Output, Conditional
Statements, For loop, While loop, Function, Classes and
Trending Posts
Objects
Complexity Analysis : Order of Growth, Asymptotic Dr B Padmaja
Vector db vs. Vectorless db Vector DBs store
Analysis, Big-O, Theta, Big – Ω, Time Complexity, Space data as high-dimensional numerical…
Complexity
AMAR DEEP
Indian IT Companies & Copilot AI Adoption
Maths, Pattern & Recursion In the past six months, major Indian IT fir…
Yash Tariyal
Theory : Recursion, Analysis of Recursion 📘 GFG Connect – Post #146 | Technical
Series ⚖️ 👉 The Art of Balancing Trade…
Easy Maths : Even or Odd, Sum of Naturals, Closest
Rukaiya
Number, Sum of Consecutive. Work Experience Naukri Campus Thrilled
Easy Pattern : Solid Rectangle, Floyd's Triangle, Hollow to share my participation in AINCAT 2026…
rectangle GOURAV PANDEY
Easy Recursion: Print 1 to n, Print n to 1, Factorial, GCD, Day - 12: The Missing Piece of Recursion
Backtracking = Recursion + Undo Aur ya…
Power
View All →
Medium Pattern : Pyramid, Hollow Diamond
Medium Maths: Count Digits, Prime Testing, Armstrong
Number, Trailing Zeros, Prime Factors, All Divisors
Hard : Butterfly, Palindrome Number, Tower of Hanoi,
Non-Attacking Knights, Josephus, Water Jug
Array & String
Theory : Array, String, Matrix
Easy Array : Is Sorted, Multiply with Adjacent, Reverse,
Reverse in Groups, Rotate, Generate All Subarrays,
[Link] 1/8
6/4/26, 12:06 PM DSA Tutorial - GeeksforGeeks
Arrange by Sign, Stock with 1 Transaction. Stock with
Multiple Transactions, Leaders
Easy String : Same Strings, Palindrome, Toggle Case,
Remove Occurrences, Remove Spaces, Check
Subsequence, First Non-Repeating, Pangram
Medium Array : Majority Element, Majority Element II,
Sorted subsequence of 3, Count Strictly Increasing
Subarrays, Next Permutation, Kadane's Algorithm, Sum
of all subarrays, Max Product Subarray
Medium String: Implement atoi, URLify, Multiply Large
Numbers
2D Array : Diagonal Traversal, Magic Square, Boundary
Traversal, Matrix Spiral, Toeplitz Matrix, Matrix Zig-Zag,
Transpose of Matrix, Rotate a matrix by 90, Conway’s
Game Of Life, Queries in a Matrix, Set Matrix 0
Hard : Max Circular Subarray Sum, Next Smallest
Palindrome, Lexicographic Rank, Text Justification
Searching
Theory : Searching
Linear Search : Largest, Second Largest, Local Min &
Max
Binary Search : Insertion Position, Lower Bound, Upper
Bound, Single Element, Missing Natural, Count
Occurrences, 2D Search, Sorted & Rotated, Sorted &
Rotated II, K Closest, Search in Almost Sorted, Peak,
Peak in 2D, Range based Counts, Kth Missing, Search in
Row-Column Sorted
Search on answer: Square Root, Nth Root, Check Power,
Pick K, N trailing zeroes, Book Allocation, Koko Eating
Banana, Aggressive Cows, Median in a Row Sorted, Kth
Smallest in Row and Column Sorted, M bouquets, kth in
Multiplication Table, Maximize Median, Min Time for
Orders, Equalize Towers
Search on Two: Median of two sorted, Kth of two sorted
Sorting
Theory : Sorting
Easy : Wave Form, Sort by Length, Min Diff Pair
Medium : Merge Overlapping, Form Largest, Tywin's
War Strategy, Candy Cost, Meeting Rooms, Insert Merge
Intervals, Minimize Moves, Max sum of i*arr[i]
Partition & Quick Sort Based : Quick Sort, Sort Binary,
Zeroes to End, Sort Ternary
Merge & Merge Sort Based : Merge Sort, Union of 2
Sorted, Intersection of 2 Sorted, Merge Without Extra
Space, Minimum Platforms, Inversion count, Surpasser
Count
Cycle Sort Based : Cycle Sort, Minimum Missing Positive,
Min Swaps to Sort
Bit Manipulation
Theory : Bitwise
[Link] 2/8
6/4/26, 12:06 PM DSA Tutorial - GeeksforGeeks
Easy : Swap without Third, Kth Set Bit, Only set bit,
Power of two, Sort by Set bits
Medium : Power of 4, Binary is palindrome, Rotate Bits,
Swap Odd Even, Count Set, Count Total Set, Iterative
Power
Bit with Arrays: Max Consecutive 1s, Missing, One Odd,
Two Odds, Palindrome Permutation, Missing &
Repeating, Unique Numbers II, n-bit Gray Codes,
Hamming Distance, Sum of Pair XORs, Sum of Subset
XORs, Subarray XORs, Is Valid Suduko
Subsets : Subsets, Subsequences
Hashing
Theory : Hashing
Basic Hashing: Linear Probing, Separate Chaining,
Quadratic Probing, Distinct in Array, Is Subset, Union,
Intersection, 2 Sum, Fizz Buzz, Pair Sums Divisible by k,
Roman to Integer, Isomorphic Strings
Hashing for Frequency: Count Frequencies, Most
Frequent, Max Subsets, Anagrams
Subsequence : Longest Consecutive Subsequence,
Consecutive Subsequence
Two-Pointer
Theory : Two-Pointer
Easy : 2 Sum in Sorted, Smallest Subarray, Unique
Elements, Sentence Palindrome
Medium : 3 Sum, Celebrity Problem, Closest Pair from 2,
Container with Most Water, Common in 3, Reverse
Words, Policemen catch thieves
Hard : 4 Sum, Closest Triplet, Count Triplets
Sliding Window
Theory : Sliding Window
Fixes Length Window: Max Sum Subarray of size K, Max
XOR of K size, Distinct In Every Window, MEX Of
Subarrays, Min Swaps to group all 1's, First negative in
every window, Chocolate Distribution
Variable Length : Maximize Ones, Equal substring with
cost less than K, Fruit Into Baskets, Subarray with given
sum
Minimum length : Smallest subarray with sum greater
than x, Minimum Window Subsequence, Minimum
Window Substring, Smallest containing 0, 1 and 2
Count Subarrays: Subarrays with k odds, Subarrays Less
Than K, Substrings with all vowels, Number of
Subarrays having sum less than K, Count Subarrays with
K Equal Value Pairs
Sliding Window with Hashing: Longest substring with
distinct, Substring character replacement, Longest
Substring with K Uniques, Substrings with k distinct,
Smallest with all characters, Smallest distinct, Count
Anagrams, Full Distinct Subarrays
[Link] 3/8
6/4/26, 12:06 PM DSA Tutorial - GeeksforGeeks
Prefix Sum
Theory : Prefix Sum
Prefix Sum: Prefix Sum Array, Prefix Sum on 2D, Range
Queries, Equilibrium Index, Mean of range, Split array,
Largest Submatrix, Max sum rectangle
Prefix / Suffix Transformation: Product of Array Except
Self, Original Array, Longest Span
Difference Array: Diff Array, 2D Diff, Max occurring in
ranges, Compute before Matrix, Point Counts from
Intervals
Prefix Sum with Hashing: Subarray with 0 sum, Largest
with 0 sum, Largest with Equal 0s and 1s, Largest with
sum divisible by k, Longest with Sum K, Count with Sum
Divisible By K, Count having Sum K, Count with given
XOR
Backtracking
Theory : Backtracking
Medium : Permutations, Rat in a Maze, Word Search
Hard : N Queen Problem, Sudoku Solver, Word Break,
Knight's Tour, Palindromic Partitions, M-Coloring
Linked-list
Theory : Linked-list, Singly, Doubly & Circular
Reversal Pattern: Reverse Singly, Reverse a Doubly,
Reverse in Groups (K-group reversal), Reorder List
Fast & Slow Pointer: Middle, Remove Nth from End,
Check Palindrome, Detect Cycle, Length of Loop,
Intersection of Y Shaped
Sorting & Merging Pattern: Sort 0s, 1s, 2s, Add Two
Numbers, Rotate, Merge K Sorted
Design : Browser History, Twitter, LRU Cache, LFU
Cache
Hard: Flattening, Clone with Random Pointer
Stack
Theory : Stack
Operations : Reverse, Sort
Expression: Check for balanced, Evaluation of Postfix
Expression, Infix Evaluation, Infix to Postfix, Redundant
Brackets, Longest Valid, Score of Balanced
Design: Stack using Queues, Two stacks in an array, K
Stacks in an Array, Stack that supports getMin()
Monotonic Stack: Lowest by removing k digits, Next
Greater Element, Stock Span Problem, Buildings Facing
Sun, Previous Smaller Element, Largest Rectangle in a
Histogram, Max of 1s, Max of Mins of every window
size, Trapping Rain Water, Subarray Range Sum,
Replace Adjacent Opposite, Longest Subarray Length
String Simulation: Decode String, Check Redundant
Brackets
[Link] 4/8
6/4/26, 12:06 PM DSA Tutorial - GeeksforGeeks
Queue
Theory : Queue
Easy : Circular Queue, Queue using Stacks, FIFO Page
Replacement, Reverse a Queue, Reverse First K
Medium : Interleave Queue, K Queues in an array, First
non-repeating in a stream, Min Knight steps for target
Deque
Theory : Deque
Easy : Circular Array Implementation
Medium : Lexicographically largest permutation, Nth
term of given recurrence relation, Generate Bitonic
Sequence
Hard : Sliding Window Maximum, Longest Subarray
with Difference ≤ X, Max Subarray Length with K
Increments, Min Deques to Sort Array
Binary Tree
Theory : Binary Tree, Inorder, Preorder, Postorder, Level
Order
Easy : Size of Tree, Depth of Tree, Max Width, Balance
Check, Identical Trees, Mirror Tree, Sum Tree, Left View,
Right View, Path Sum, Max Path Sum, Serialize and
Deserialize,
Iterative Traversals : Inorder, Preorder, Postorder, Morris
Inorder
Medium : Longest Sum, Diameter, Boundary Traversal,
Tree from Preorder and Inorder, Leaf at Same Level,
Connect at Same Level, Nodes without siblings, Invert
Tree, Flatten Tree, Max Diff Node & Ancestor
Horizontal Distance Based: Vertical Traversal, Bottom
View, Top View, Diagonal Traversal
Hard : Spiral Level Order, LCA, Distance K, Distributed
Candies, Subtree
Binary Search Tree
Theory : Binary Search Tree
Operations: Search, Insert, Delete, Ceil, Floor,
Predecessor and Successor
Traversal: Kth Smallest Element, 2 Sum in BST
Construction: Sorted Array to BST, Merge two BSTs
Property: Validate BST, LCA, Recover BST, Largest BST
Subtree
Heap
Theory : Heap
Easy : Check for Heap, Heap Sort, kth Largest, K
Largests, Height of a Heap
Medium : Connect n ropes, Nearly Sorted, BST to Min
Heap, K Max sum combinations
[Link] 5/8
6/4/26, 12:06 PM DSA Tutorial - GeeksforGeeks
Hard : Median in a stream, K’th largest in a stream,
Merge k sorted, Range Covering K Sorted Lists, The
Skyline Problem, Sort by Frequency
Graph
Theory : Graph Representation
BFS/DFS Traversal: BFS, DFSl, Flood Fill, Islands,
Connected Components in an Undirected Graph, Cycle in
an Undirected graph, Cycle in a Directed, Bipartite,
Rotten Oranges, Remove Invalid Parentheses
Topological Sorting: Topological Sorting, Course
Schedule I, Course Schedule II, Alien Dictionary
Shortest Path: Dijkstra, Floyd Warshall, Bellman–Ford,
Minimizing Infection Time in a Directed Graph, Shortest
path with one curved edge in an undirected Graph,
Minimum Cost Path, Shortest cycle in an undirected
graph
Multi-Source BFS: Distance of nearest 1, Unlock the
Lock, Word Ladder
MST/DSU: Prim, Disjoint Set, Kruskal, Detect Cycle using
DSU, Total Spanning Trees, Job Sequencing, Number of
connected components
Greedy
Theory : Greedy
Easy : Fractional Knapsack, Assign Cookies, Min and Max
Costs to buy all, Smallest Subset Greater Sum, Min
Notes with Given Sum
Medium : Activity Selection, Huffman Coding, Jump
Game, Job Sequencing, Non-Overlapping Intervals, Gas
Station
Hard : Stable Marriage, Minimize the Max Height Diff,
No two adjacent are same, Minimize cash flow, Min time
to finish all jobs with given constraints, Min Cost to cut
into squares
Dynamic Programming
Theory : Dynamic Programming
1-D DP: Climbing Stairs, Count without consecutive 1s,
Weighted Climbing Stairs, Frog Jump, House Robber,
Max Segments, Coin Change, Possible Decodings, Word
Break, Derangements
2-D DP: Unique Paths, Minimum cost Path, Longest
Common Subsequence, Edit Distance, Distinct
Subsequences, Largest Square Submatrix with All 1s
SubSequence: Partition Subset, Subset Sum, Subset
Count With Sum, Target Sum, 0/1 Knapsack, Coin
Change II, Rod Cutting
Grid: Unique Paths in a Grid, Maximum path sum in
matrix, Longest Increasing Path
String: Longest Common Substring, Shortest Common
Supersequence, Interleaving String, Wildcard Matching,
Longest Palindromic Substring
[Link] 6/8
6/4/26, 12:06 PM DSA Tutorial - GeeksforGeeks
Stock: Buy and Sell with Cooldown, Buy and Sell – Max
2 Transactions Allowed, Buy and Sell - k Transactions,
Buy and Sell with Transaction Fee
LIS: Longest Increasing Subsequence, Number of LISs,
Longest Bitonic, Largest Divisible, Longest String Chain,
Maximum envelopes
Partition: Matrix Chain Multiplication, Minimum Cost to
Cut a Stick, Palindrome Partitioning, Boolean
Parenthesization, Partition Array for Maximum Sum, Egg
Dropping, Optimal Strategy
Number Theory
Easy : nCr, Euler's Totient
Medium : Sieve of Eratosthenes, Pascal's Triangle,
Modular Exponentiation
Hard : Segmented Sieve
Trie
Implementation: Implement Trie, Longest Word With All
Prefixes, Count of distinct substrings
Bit Manipulation Trie: Duplicates in Binary Matrix, Max
XOR of Two, Maximum XOR Queries, Pairs with XOR
less than K
Advanced Trie Application: Search Suggestions System,
Palindrome Pairs
String Matching
Theory : Substring
Standard Problems : Rabin-Karp, KMP, Z algorithm,
Longest Prefix Suffix, Manacher's Algorithm, Subarray
Search
Hard : Longest Palindromic Substring, Palindrome
Substring Queries, Min Repeats for Substring
Range Query
Basic Segment Tree Queries: Segment Tree, Min-Max
Range Queries, Range LCM Queries, XOR of a given
range
Segment Tree with Updates: Lazy Propagation, Flipping
Sign
Segment Tree Applications: Build a segment tree for N-
ary rooted tree, Maximum of all subarrays of size K
using Segment Tree
Fenwick Tree: Fenwick Tree, Sum and Update Queries on
3D Matrix
Topic Wise Complete Tutorials
Below are the recommended different topics to learn
complete DSA.
Fundamentals : Maths, Complexity Analysis
Data Structures : Array, Hashing, Strings, Matrix, Linked
List, Stack, Queue, Deque, Tree, Heap, Graph
[Link] 7/8
6/4/26, 12:06 PM DSA Tutorial - GeeksforGeeks
Algorithms : Searching, Sorting, Two Pointer, Window
Sliding, Prefix Sum, Recursion, Greedy Algorithms,
Dynamic Programming
Advanced Topics : Trie, Segment Tree, Red-Black Tree &
Binary Indexed Tree
Other Algorithms : Bitwise Algorithms, Backtracking,
Divide and Conquer, Branch and Bound, Geometric &
Randomized
Roadmap to learn DSA Visit Course
Comment R Rishab… 1.82k
Article Tags: DSA Tutorials DSA Tutorials
Company Explore Tutorials Courses Preparation
About Us POTD Programming ML and Data Corner
Corporate & Communications Address: Legal Practice Languages Science Interview
Privacy Policy Problems DSA DSA and Corner
A-143, 7th Floor, Sovereign Corporate
Tower, Sector- 136, Noida, Uttar Careers Connect Web Placements Aptitude
Pradesh (201305) Contact Us Blogs Technology Web Puzzles
Corporate Upskill AI, ML & Data Development GfG 160
Registered Address:
Solution Courses Science Data Science System Design
K 061, Tower K, Gulshan Vivante Campus DevOps Programming
Apartment, Sector 137, Noida, Gautam
Training CS Core Languages
Buddh Nagar, Uttar Pradesh, 201305
Program Subjects DevOps &
GATE Cloud
School GATE
Subjects MongoDB
Software and Certifications
Tools
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
[Link] 8/8