| Topic/Article | Solution | |
|---|---|---|
| Java Collections or C++ STL |
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Count Digits |
|
|
||
| Reverse a Number |
|
|
|
|
| Check Palindrome |
|
|
|
|
| GCD Or HCF |
|
|
||
| Armstrong Numbers |
|
|
|
|
| Print all Divisors |
|
|
||
| Check for Prime |
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Hashing Theory |
|
|||
| Counting frequencies of array elements |
|
|||
| Find the highest/lowest frequency element |
|
| Topic/Article | GfG | Video | Leetcode | |
|---|---|---|---|---|
| Selection Sort |
|
|
||
| Bubble Sort |
|
|
||
| Insertion Sort |
|
|
| Topic/Article | GfG | Video | Leetcode | |
|---|---|---|---|---|
| Merge Sort |
|
|
||
| Recursive Bubble Sort |
|
|||
| Recursive Insertion Sort |
|
|||
| Quick Sort |
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Binary Search to find X in sorted array |
|
|
||
| Implement Lower Bound |
|
|||
| Implement Upper Bound |
|
|||
| Search Insert Position |
|
|
||
| Floor/Ceil in Sorted Array | ||||
| 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 |
|
|
||
| Find out how many times has an array been rotated |
|
|||
| Single element in a Sorted Array |
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Find the row with maximum number of 1 ’s |
|
|||
| Search in a 2 D matrix |
|
|
|
|
| Find Peak Element |
|
|
||
| Matrix Median |
|
|
| 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 |
|
|
| 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 |
|
|
| 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 |
|
| 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 |
|
| 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 |
|
|
|
| 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 |
|
| 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 |
|
|
|
| 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 |
|
| 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 |
|
|
| 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 |
|
|
| 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 |
|
| 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 |
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Sliding Window maximum |
|
|
|
|
| Stock Span Problem |
|
|
||
| The Celebrity Problem |
|
|
||
| Rotten Oranges |
|
|
|
|
| LRU cache (IMPORTANT) |
|
|
|
|
| LFU cache |
|
|
|
| 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 |
|
|
| 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 |
| 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 |
|
| 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 |
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Assign Cookies |
|
|
||
| Fractional Knapsack Problem |
|
|
||
| Greedy algorithm to find minimum number of coins |
|
|
||
| Lemonade Change |
|
|
||
| Valid Paranthesis Checker |
|
|
| 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 |
|
|
| 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 |
|
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Introduction to Binary Search Tree |
|
|
||
| Search in a Binary Search Tree |
|
|
|
|
| Find Min/Max in BST |
|
| 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 |
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Graph and Types |
|
|
||
| Graph Representation | C++ |
|
|
||
| Graph Representation | Java |
|
|
||
| Connected Components | Logic Explanation |
|
|
||
| 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) |
|
|
| 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 |
|
|
|
| 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 |
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Bridges in Graph |
|
|
|
|
| Articulation Point |
|
|
||
| Kosaraju ’s Algorithm |
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Dynamic Programming Introduction |
|
|
| 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) |
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Maximum Rectangle Area with all 1’s|(DP-55) |
|
|
|
|
| Count Square Submatrices with All Ones|(DP-56) |
|
|
|
| Topic/Article | GfG | Solution | Leetcode | |
|---|---|---|---|---|
| Implement TRIE | INSERT | SEARCH | STARTSWITH |
|
|
|
| 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 |
|
|
|