Skip to content

draco-malfoy/DCS-LoveBabbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 

Repository files navigation

DSA Cracker Sheet by Love Babbar

Link to the video describing this sheet.

Link to the original sheet.

Here's a collage of awesome DSA crackers.

- - - - -
Arrays Matrix String Searching & Sorting Linked List
Binary Trees Binary Search Trees Greedy BackTracking Stacks & Queues
Heap Graph Trie Dynamic Programming Bit Manipulation

Arrays

S. No. Problem Reference C++ Java Python Other languages
01 Reverse the array GeeksForGeeks 0 1 0 -
02 Find the maximum and minimum element in an array GeeksForGeeks 0 1 0 -
03 Find the "Kth" max and min element of an array GeeksForGeeks 0 1 0 -
04 Given an array which consists of only 0, 1 and 2. Sort the array without using any sorting algo GeeksForGeeks 0 1 0 -
05 Move all the negative elements to one side of the array GeeksForGeeks 0 1 0 -
06 Find the Union and Intersection of the two sorted arrays GeeksForGeeks 0 1 0 -
07 Write a program to cyclically rotate an array by one. GeeksForGeeks 0 1 0 -
08 Find Largest sum contiguous Subarray [V. IMP] GeeksForGeeks 0 1 0 -
09 Minimise the maximum difference between heights [V.IMP] GeeksForGeeks 0 1 0 -
10 Minimum no. of Jumps to reach end of an array GeeksForGeeks 0 0 0 -
11 Find duplicate in an array of N+1 Integers Leetcode 0 0 0 -
12 Merge 2 sorted arrays without using Extra space GeeksForGeeks 0 0 0 -
13 Kadane's Algo [V.V.V.V.V IMP] GeeksForGeeks 0 0 0 -
14 Merge Intervals Leetcode 0 0 0 -
15 Next Permutation Leetcode 0 0 0 -
16 Count Inversion GeeksForGeeks 0 0 0 -
17 Best time to buy and Sell stock Leetcode 0 0 0 -
18 Find all pairs on integer array whose sum is equal to given number GeeksForGeeks 0 0 0 -
19 Find common elements In 3 sorted arrays GeeksForGeeks 0 0 0 -
20 Rearrange the array in alternating positive and negative items with O(1) extra space GeeksForGeeks 0 0 0 -
21 Find if there is any subarray with sum equal to 0 GeeksForGeeks 0 0 0 -
22 Find factorial of a large number GeeksForGeeks 0 0 0 -
23 Find maximum product subarray GeeksForGeeks 0 0 0 -
24 Find longest consecutive subsequence GeeksForGeeks 0 0 0 -
25 Given an array of size n and a number k, fin all elements that appear more than " n/k " times GeeksForGeeks 0 0 0 -
26 Maximum profit by buying and selling a share atmost twice GeeksForGeeks 0 0 0 -
27 Find whether an array is a subset of another array GeeksForGeeks 0 0 0 -
28 Find the triplet that sum to a given value GeeksForGeeks 0 0 0 -
29 Trapping Rain water problem GeeksForGeeks 0 0 0 -
30 Chocolate Distribution problem GeeksForGeeks 0 0 0 -
31 Smallest Subarray with sum greater than a given value GeeksForGeeks 0 0 0 -
32 Three way partitioning of an array around a given value GeeksForGeeks 0 0 0 -
33 Minimum swaps required bring elements less equal K together GeeksForGeeks 0 0 0 -
34 Minimum no. of operations required to make an array palindrome GeeksForGeeks 0 0 0 -
35 Median of 2 sorted arrays of equal size GeeksForGeeks 0 0 0 -
36 Median of 2 sorted arrays of different size GeeksForGeeks 0 0 0 -

Matrix

S. No. Problem Reference C++ Java Python Other languages
37 Spiral traversal on a Matrix GeeksForGeeks 0 0 0 -
38 Search an element in a matrix Leetcode 0 0 0 -
39 Find median in a row wise sorted matrix GeeksForGeeks 0 0 0 -
40 Find row with maximum no. of 1's GeeksForGeeks 0 0 0 -
41 Print elements in sorted order using row-column wise sorted matrix GeeksForGeeks 0 0 0 -
42 Maximum size rectangle GeeksForGeeks 0 0 0 -
43 Find a specific pair in matrix GeeksForGeeks 0 0 0 -
44 Rotate matrix by 90 degrees GeeksForGeeks 0 0 0 -
45 Kth smallest element in a row-cpumn wise sorted matrix GeeksForGeeks 0 0 0 -
46 Common elements in all rows of a given matrix GeeksForGeeks 0 0 0 -

String

S. No. Problem Reference C++ Java Python Other languages
47 Reverse a String Leetcode 0 0 0 -
48 Check whether a String is Palindrome or not GeeksForGeeks 0 0 0 -
49 Find Duplicate characters in a string GeeksForGeeks 0 0 0 -
50 Why strings are immutable in Java? GeeksForGeeks 0 0 0 -
51 Write a Code to check whether one string is a rotation of another GeeksForGeeks 0 0 0 -
52 Write a Program to check whether a string is a valid shuffle of two strings or not GeeksForGeeks 0 0 0 -
53 Count and Say problem Leetcode 0 0 0 -
54 Write a program to find the longest Palindrome in a string.[ Longest palindromic Substring] GeeksForGeeks 0 0 0 -
55 Find Longest Recurring Subsequence in String GeeksForGeeks 0 0 0 -
56 Print all Subsequences of a string GeeksForGeeks 0 0 0 -
57 Print all the permutations of the given string GeeksForGeeks 0 0 0 -
58 Split the Binary string into two substring with equal 0’s and 1’s GeeksForGeeks 0 0 0 -
59 Word Wrap Problem [VERY IMP] GeeksForGeeks 0 0 0 -
60 EDIT Distance [Very Imp] GeeksForGeeks 0 0 0 -
61 Find next greater number with same set of digits. [Very Very IMP] GeeksForGeeks 0 0 0 -
62 Balanced Parenthesis problem.[Imp] GeeksForGeeks 0 0 0 -
63 Word break Problem[ Very Imp] GeeksForGeeks 0 0 0 -
64 Rabin Karp Algo GeeksForGeeks 0 0 0 -
65 KMP Algo GeeksForGeeks 0 0 0 -
66 Convert a Sentence into its equivalent mobile numeric keypad sequence GeeksForGeeks 0 0 0 -
67 Minimum number of bracket reversals needed to make an expression balanced GeeksForGeeks 0 0 0 -
68 Count All Palindromic Subsequence in a given String GeeksForGeeks 0 0 0 -
69 Count of number of given string in 2D character array GeeksForGeeks 0 0 0 -
70 Search a Word in a 2D Grid of characters GeeksForGeeks 0 0 0 -
71 Boyer Moore Algorithm for Pattern Searching GeeksForGeeks 0 0 0 -
72 Converting Roman Numerals to Decimal GeeksForGeeks 0 0 0 -
73 Longest Common Prefix LeetCode 0 0 0 -
74 Number of flips to make binary string alternate GeeksForGeeks 0 0 0 -
75 Find the first repeated word in string GeeksForGeeks 0 0 0 -
76 Minimum number of swaps for bracket balancing GeeksForGeeks 0 0 0 -
77 Find the longest common subsequence between two strings GeeksForGeeks 0 0 0 -
78 Program to generate all possible valid IP addresses from given string GeeksForGeeks 0 0 0 -
79 Write a program to find the smallest window that contains all characters of string itself GeeksForGeeks 0 0 0 -
80 Rearrange characters in a string such that no two adjacent are same GeeksForGeeks 0 0 0 -
81 Minimum characters to be added at front to make string palindrome GeeksForGeeks 0 0 0 -
82 Given a sequence of words, print all anagrams together GeeksForGeeks 0 0 0 -
83 Find the smallest window in a string containing all characters of another string GeeksForGeeks 0 0 0 -
84 Recursively remove all adjacent duplicates GeeksForGeeks 0 0 0 -
85 String matching where one string contains wildcard characters GeeksForGeeks 0 0 0 -
86 Function to find Number of customers who could not get a computer GeeksForGeeks 0 0 0 -
87 Transform One String to Another using Minimum Number of Given Operation GeeksForGeeks 0 0 0 -
88 Check if two given strings are isomorphic to each other GeeksForGeeks 0 0 0 -
89 Recursively print all sentences that can be formed from list of word lists GeeksForGeeks 0 0 0 -

Searching & Sorting

S. No. Problem Reference C++ Java Python Other languages
90 Find first and last positions of an element in a sorted array GeeksForGeeks 0 0 0 -
91 Find a Fixed Point (Value equal to index) in a given array GeeksForGeeks 0 0 0 -
92 Search in a rotated sorted array LeetCode 0 0 0 -
93 Square root of an integer GeeksForGeeks 0 0 0 -
94 Maximum and minimum of an array using minimum number of comparisons GeeksForGeeks 0 0 0 -
95 Optimum location of point to minimize total distance GeeksForGeeks 0 0 0 -
96 Find the repeating and the missing GeeksForGeeks 0 0 0 -
97 Find majority element GeeksForGeeks 0 0 0 -
98 Searching in an array where adjacent differ by at most k GeeksForGeeks 0 0 0 -
99 Find a pair with a given difference GeeksForGeeks 0 0 0 -
100 Find four elements that sum to a given value GeeksForGeeks 0 0 0 -
101 Maximum sum such that no 2 elements are adjacent GeeksForGeeks 0 0 0 -
102 Count triplet with sum smaller than a given value GeeksForGeeks 0 0 0 -
103 Merge 2 sorted arrays GeeksForGeeks 0 0 0 -
104 Print all subarrays with 0 sum GeeksForGeeks 0 0 0 -
105 Product array Puzzle GeeksForGeeks 0 0 0 -
106 Sort array according to count of set bits GeeksForGeeks 0 0 0 -
107 Minimum no. of swaps required to sort the array GeeksForGeeks 0 0 0 -
108 Bishu and Soldiers HackerEarth 0 0 0 -
109 Rasta and Kheshtak HackerEarth 0 0 0 -
110 Kth smallest number again HackerEarth 0 0 0 -
111 Find pivot element in a sorted array TheoryofProgramming 0 0 0 -
112 K-th Element of Two Sorted Arrays GeeksForGeeks 0 0 0 -
113 Aggressive cows SPOJ 0 0 0 -
114 Book Allocation Problem GeeksForGeeks 0 0 0 -
115 EKOSPOJ: SPOJ 0 0 0 -
116 Job Scheduling Algo GeeksForGeeks 0 0 0 -
117 Missing Number in AP GeeksForGeeks 0 0 0 -
118 Smallest number with atleastn trailing zeroes infactorial GeeksForGeeks 0 0 0 -
119 Painters Partition Problem: GeeksForGeeks 0 0 0 -
120 ROTI-Prata SPOJ SPOJ 0 0 0 -
121 DoubleHelix SPOJ SPOJ 0 0 0 -
122 Subset Sums SPOJ 0 0 0 -
123 Find the inversion count GeeksForGeeks 0 0 0 -
124 Implement Merge-sort in-place GeeksForGeeks 0 0 0 -
125 Partitioning and Sorting Arrays with Many Repeated Entries Bealdung 0 0 0 -

LinkedList

S. No. Problem Reference C++ Java Python Other languages
126 Write a Program to reverse the Linked List. (Both Iterative and recursive) GeeksForGeeks 0 0 0 -
127 Reverse a Linked List in group of Given Size. [Very Imp] GeeksForGeeks 0 0 0 -
128 Write a program to Remove loop in a linked list GeeksForGeeks 0 0 0 -
129 Write a program to Delete loop in a linked list GeeksForGeeks 0 0 0 -
130 Find the starting point of the loop GeeksForGeeks 0 0 0 -
131 Remove Duplicates in a sorted Linked List GeeksForGeeks 0 0 0 -
132 Remove Duplicates in a Un-sorted Linked List GeeksForGeeks 0 0 0 -
133 Write a Program to Move the last element to Front in a Linked List GeeksForGeeks 0 0 0 -
134 Add “1” to a number represented as a Linked List GeeksForGeeks 0 0 0 -
135 Add two numbers represented by linked lists GeeksForGeeks 0 0 0 -
136 Intersection of two Sorted Linked List GeeksForGeeks 0 0 0 -
137 Intersection Point of two Linked Lists GeeksForGeeks 0 0 0 -
138 Merge Sort For Linked lists.[Very Important] GeeksForGeeks 0 0 0 -
139 Quicksort for Linked Lists.[Very Important] GeeksForGeeks 0 0 0 -
140 Find the middle Element of a linked list LeetCode 0 0 0 -
141 Check if a linked list is a circular linked list GeeksForGeeks 0 0 0 -
142 Split a Circular linked list into two halves GeeksForGeeks 0 0 0 -
143 Write a Program to check whether the Singly Linked list is a palindrome or not GeeksForGeeks 0 0 0 -
144 Deletion from a Circular Linked List GeeksForGeeks 0 0 0 -
145 Reverse a Doubly Linked list GeeksForGeeks 0 0 0 -
146 Find pairs with a given sum in a DLL GeeksForGeeks 0 0 0 -
147 Count triplets in a sorted DLL whose sum is equal to given value “X” GeeksForGeeks 0 0 0 -
148 Sort a “k”sorted Doubly Linked list.[Very IMP] GeeksForGeeks 0 0 0 -
149 Rotate DoublyLinked list by N nodes GeeksForGeeks 0 0 0 -
150 Rotate a Doubly Linked list in group of Given Size.[Very IMP] GeeksForGeeks 0 0 0 -
151 Can we reverse a linked list in less than O(n) ? GeeksForGeeks 0 0 0 -
152 Why Quicksort is preferred for. Arrays and Merge Sort for LinkedLists ? GeeksForGeeks 0 0 0 -
153 Flatten a Linked List GeeksForGeeks 0 0 0 -
154 Sort a LL of 0's, 1's and 2's GeeksForGeeks 0 0 0 -
155 Clone a linked list with next and random pointer GeeksForGeeks 0 0 0 -
156 Merge K sorted Linked list GeeksForGeeks 0 0 0 -
157 Multiply 2 no. represented by LL GeeksForGeeks 0 0 0 -
158 Delete nodes which have a greater value on right side GeeksForGeeks 0 0 0 -
159 Segregate even and odd nodes in a Linked List GeeksForGeeks 0 0 0 -
160 Program for n’th node from the end of a Linked List GeeksForGeeks 0 0 0 -
161 Find the first non-repeating character from a stream of characters GeeksForGeeks 0 0 0 -

Binary Trees

S. No. Problem Reference C++ Java Python Other languages
162 Level order traversal GeeksForGeeks 0 0 0 -
163 Reverse Level Order traversal GeeksForGeeks 0 0 0 -
164 Height of a tree GeeksForGeeks 0 0 0 -
165 Diameter of a tree GeeksForGeeks 0 0 0 -
166 Mirror of a tree GeeksForGeeks 0 0 0 -
167 Inorder Traversal of a tree both using recursion and Iteration TechieDelight 0 0 0 -
168 Preorder Traversal of a tree both using recursion and Iteration TechieDelight 0 0 0 -
169 Postorder Traversal of a tree both using recursion and Iteration TechieDelight 0 0 0 -
170 Left View of a tree GeeksForGeeks 0 0 0 -
171 Right View of Tree GeeksForGeeks 0 0 0 -
172 Top View of a tree GeeksForGeeks 0 0 0 -
173 Bottom View of a tree GeeksForGeeks 0 0 0 -
174 Zig-Zag traversal of a binary tree GeeksForGeeks 0 0 0 -
175 Check if a tree is balanced or not GeeksForGeeks 0 0 0 -
176 Diagnol Traversal of a Binary tree GeeksForGeeks 0 0 0 -
177 Boundary traversal of a Binary tree GeeksForGeeks 0 0 0 -
178 Construct Binary Tree from String with Bracket Representation GeeksForGeeks 0 0 0 -
179 Convert Binary tree into Doubly Linked List GeeksForGeeks 0 0 0 -
180 Convert Binary tree into Sum tree GeeksForGeeks 0 0 0 -
181 Construct Binary tree from Inorder and preorder traversal GeeksForGeeks 0 0 0 -
182 Find minimum swaps required to convert a Binary tree into BST GeeksForGeeks 0 0 0 -
183 Check if Binary tree is Sum tree or not GeeksForGeeks 0 0 0 -
184 Check if all leaf nodes are at same level or not GeeksForGeeks 0 0 0 -
185 Check if a Binary Tree contains duplicate subtrees of size 2 or more [ IMP ] GeeksForGeeks 0 0 0 -
186 Check if 2 trees are mirror or not GeeksForGeeks 0 0 0 -
187 Sum of Nodes on the Longest path from root to leaf node GeeksForGeeks 0 0 0 -
188 Check if given graph is tree or not. [ IMP ] GeeksForGeeks 0 0 0 -
189 Find Largest subtree sum in a tree GeeksForGeeks 0 0 0 -
190 Maximum Sum of nodes in Binary tree such that no two are adjacent GeeksForGeeks 0 0 0 -
191 Print all "K" Sum paths in a Binary tree GeeksForGeeks 0 0 0 -
192 Find LCA in a Binary tree GeeksForGeeks 0 0 0 -
193 Find distance between 2 nodes in a Binary tree GeeksForGeeks 0 0 0 -
194 Kth Ancestor of node in a Binary tree GeeksForGeeks 0 0 0 -
195 Find all Duplicate subtrees in a Binary tree [ IMP ] [GeeksForGeeks]https://practice.geeksforgeeks.org/problems/duplicate-subtrees/1) 0 0 0 -
196 Tree Isomorphism Problem GeeksForGeeks 0 0 0 -

Binary Search Trees

S. No. Problem Reference C++ Java Python Other languages
197 Find a value in a BST GeeksForGeeks 0 0 0 -
198 Deletion of a node in a BST LeetCode 0 0 0 -
199 Find min and max value in a BST GeeksForGeeks 0 0 0 -
200 Find inorder successor and inorder predecessor in a BST GeeksForGeeks 0 0 0 -
201 Check if a tree is a BST or not GeeksForGeeks 0 0 0 -
202 Populate Inorder successor of all nodes GeeksForGeeks 0 0 0 -
203 Find LCA of 2 nodes in a BST GeeksForGeeks 0 0 0 -
204 Construct BST from preorder traversal GeeksForGeeks 0 0 0 -
205 Convert Binary tree into BST GeeksForGeeks 0 0 0 -
206 Convert a normal BST into a Balanced BST GeeksForGeeks 0 0 0 -
207 Merge two BST [ V.V.V>IMP ] GeeksForGeeks 0 0 0 -
208 Find Kth largest element in a BST GeeksForGeeks 0 0 0 -
209 Find Kth smallest element in a BST GeeksForGeeks 0 0 0 -
210 Count pairs from 2 BST whose sum is equal to given value "X" GeeksForGeeks 0 0 0 -
211 Find the median of BST in O(n) time and O(1) space GeeksForGeeks 0 0 0 -
212 Count BST ndoes that lie in a given range GeeksForGeeks 0 0 0 -
213 Replace every element with the least greater element on its right GeeksForGeeks 0 0 0 -
214 Given "n" appointments, find the conflicting appointments GeeksForGeeks 0 0 0 -
215 Check preorder is valid or not GeeksForGeeks 0 0 0 -
216 Check whether BST contains Dead end GeeksForGeeks 0 0 0 -
217 Largest BST in a Binary Tree [ V.V.V.V.V IMP ] GeeksForGeeks 0 0 0 -
218 Flatten BST to sorted list GeeksForGeeks 0 0 0 -

Greedy

S. No. Problem Reference C++ Java Python Other languages
219 Activity Selection Problem GeeksForGeeks 0 0 0 -
220 Job SequencingProblem GeeksForGeeks 0 0 0 -
221 Huffman Coding GeeksForGeeks 0 0 0 -
222 Water Connection Problem GeeksForGeeks 0 0 0 -
223 Fractional Knapsack Problem GeeksForGeeks 0 0 0 -
224 Greedy Algorithm to find Minimum number of Coins GeeksForGeeks 0 0 0 -
225 Maximum trains for which stoppage can be provided GeeksForGeeks 0 0 0 -
226 Minimum Platforms Problem GeeksForGeeks 0 0 0 -
227 Buy Maximum Stocks if i stocks can be bought on i-th day GeeksForGeeks 0 0 0 -
228 Find the minimum and maximum amount to buy all N candies GeeksForGeeks 0 0 0 -
229 Minimize Cash Flow among a given set of friends who have borrowed money from each other GeeksForGeeks 0 0 0 -
230 Minimum Cost to cut a board into squares GeeksForGeeks 0 0 0 -
231 Check if it is possible to survive on Island GeeksForGeeks 0 0 0 -
232 Find maximum meetings in one room GeeksForGeeks 0 0 0 -
233 Maximum product subset of an array GeeksForGeeks 0 0 0 -
234 Maximize array sum after K negations GeeksForGeeks 0 0 0 -
235 Maximize the sum of arr[i] * i GeeksForGeeks 0 0 0 -
236 Maximum sum of absolute difference of an array GeeksForGeeks 0 0 0 -
237 Maximize sum of consecutive differences in a circular array GeeksForGeeks 0 0 0 -
238 Minimum sum of absolute difference of pairs of two arrays GeeksForGeeks 0 0 0 -
239 Program for Shortest Job First (or SJF) CPU Scheduling GeeksForGeeks 0 0 0 -
240 Program for Least Recently Used (LRU) Page Replacement algorithm GeeksForGeeks 0 0 0 -
241 Smallest subset with sum greater than all other elements GeeksForGeeks 0 0 0 -
242 Chocolate Distribution Problem GeeksForGeeks 0 0 0 -
243 DEFKIN -Defense of a Kingdom SPOJ 0 0 0 -
244 DIEHARD -DIE HARD SPOJ 0 0 0 -
245 GERGOVIA -Wine trading in Gergovia SPOJ 0 0 0 -
246 Picking Up Chicks SPOJ 0 0 0 -
247 CHOCOLA –Chocolate SPOJ 0 0 0 -
248 ARRANGE -Arranging Amplifiers SPOJ 0 0 0 -
249 K Centers Problem GeeksForGeeks 0 0 0 -
250 Minimum Cost of ropes GeeksForGeeks 0 0 0 -
251 Find smallest number with given number of digits and sum of digits GeeksForGeeks 0 0 0 -
252 Rearrange characters in a string such that no two adjacent are same GeeksForGeeks 0 0 0 -
253 Find maximum sum possible equal sum of three stacks GeeksForGeeks 0 0 0 -

BackTracking

S. No. Problem Reference C++ Java Python Other languages
254 Rat in a maze Problem GeeksForGeeks 0 0 0 -
255 Printing all solutions in N-Queen Problem GeeksForGeeks 0 0 0 -
256 Word Break Problem using Backtracking GeeksForGeeks 0 0 0 -
257 Remove Invalid Parentheses LeetCode 0 0 0 -
258 Sudoku Solver LeetCode 0 0 0 -
259 M Coloring Problem GeeksForGeeks 0 0 0 -
260 Print all palindromic partitions of a string GeeksForGeeks 0 0 0 -
261 Subset Sum Problem GeeksForGeeks 0 0 0 -
262 The Knight’s tour problem GeeksForGeeks 0 0 0 -
263 Tug of War GeeksForGeeks 0 0 0 -
264 Find shortest safe route in a path with landmines GeeksForGeeks 0 0 0 -
265 Combinational Sum GeeksForGeeks 0 0 0 -
266 Find Maximum number possible by doing at-most K swaps GeeksForGeeks 0 0 0 -
267 Print all permutations of a string GeeksForGeeks 0 0 0 -
268 Find if there is a path of more than k length from a source GeeksForGeeks 0 0 0 -
269 Longest Possible Route in a Matrix with Hurdles GeeksForGeeks 0 0 0 -
270 Print all possible paths from top left to bottom right of a mXn matrix GeeksForGeeks 0 0 0 -
271 Partition of a set intoK subsets with equal sum GeeksForGeeks 0 0 0 -
272 Find the K-th Permutation Sequence of first N natural numbers GeeksForGeeks 0 0 0 -

Stacks & Queues

S. No. Problem Reference C++ Java Python Other languages
273 Implement Stack from Scratch TutorialsPoint 0 0 0 -
274 Implement Queue from Scratch GeeksForGeeks 0 0 0 -
275 Implement 2 stack in an array GeeksForGeeks 0 0 0 -
276 Find the middle element of a stack GeeksForGeeks 0 0 0 -
277 Implement "N" stacks in an Array GeeksForGeeks 0 0 0 -
278 Check the expression has valid or Balanced parenthesis or not GeeksForGeeks 0 0 0 -
279 Reverse a String using Stack GeeksForGeeks 0 0 0 -
280 Design a Stack that supports getMin() in O(1) time and O(1) extra space GeeksForGeeks 0 0 0 -
281 Find the next Greater element GeeksForGeeks 0 0 0 -
282 The celebrity Problem GeeksForGeeks 0 0 0 -
283 Arithmetic Expression evaluation GeeksForGeeks.) 0 0 0 -
284 Evaluation of Postfix expression GeeksForGeeks 0 0 0 -
285 Implement a method to insert an element at its bottom without using any other data structure StackOverflow 0 0 0 -
286 Reverse a stack using recursion GeeksForGeeks 0 0 0 -
287 Sort a Stack using recursion GeeksForGeeks 0 0 0 -
288 Merge Overlapping Intervals GeeksForGeeks 0 0 0 -
289 Largest rectangular Area in Histogram GeeksForGeeks 0 0 0 -
290 Length of the Longest Valid Substring GeeksForGeeks 0 0 0 -
291 Expression contains redundant bracket or not GeeksForGeeks 0 0 0 -
292 Implement Stack using Queue GeeksForGeeks 0 0 0 -
293 Implement Stack using Deque GeeksForGeeks 0 0 0 -
294 [Stack Permutations (Check if an array is stack permutation of other)](https://github.com/draco-malfoy/DCS-LoveBabbar/tree/main/Database/Stacks%20%26%20Queues/Stack%20Permutations%20(Check%20if%20an%20array%20is%20stack%20permutation%20of%20other) GeeksForGeeks) 0 0 0 -
295 Implement Queue using Stack GeeksForGeeks 0 0 0 -
296 Implement "n" queue in an array GeeksForGeeks 0 0 0 -
297 Implement a Circular queue GeeksForGeeks 0 0 0 -
298 LRU Cache Implementationa GeeksForGeeks 0 0 0 -
299 Reverse a Queue using recursion GeeksForGeeks 0 0 0 -
300 Reverse the first “K” elements of a queue GeeksForGeeks 0 0 0 -
301 Interleave the first half of the queue with second half GeeksForGeeks 0 0 0 -
302 Find the first circular tour that visits all Petrol Pumps GeeksForGeeks 0 0 0 -
303 Minimum time required to rot all oranges GeeksForGeeks 0 0 0 -
304 Distance of nearest cell having 1 in a binary matrix GeeksForGeeks 0 0 0 -
305 First negative integer in every window of size “k” GeeksForGeeks 0 0 0 -
306 Check if all levels of two trees are anagrams or not GeeksForGeeks 0 0 0 -
307 Sum of minimum and maximum elements of all subarrays of size “k” GeeksForGeeks 0 0 0 -
308 Minimum sum of squares of character counts in a given string after removing “k” characters GeeksForGeeks 0 0 0 -
309 Queue based approach or first non-repeating character in a stream GeeksForGeeks 0 0 0 -
310 Next Smaller Element GeeksForGeeks 0 0 0 -

Heap

S. No. Problem Reference C++ Java Python Other languages
311 Implement a Maxheap/MinHeap using arrays and recursion GeeksForGeeks 0 0 0 -
312 Sort an Array using heap. (HeapSort) GeeksForGeeks 0 0 0 -
313 Maximum of all subarrays of size k GeeksForGeeks 0 0 0 -
314 “k” largest element in an array GeeksForGeeks 0 0 0 -
315 Kth smallest and largest element in an unsorted array GeeksForGeeks 0 0 0 -
316 Merge “K” sorted arrays. [ IMP ] GeeksForGeeks 0 0 0 -
317 Merge 2 Binary Max Heaps GeeksForGeeks 0 0 0 -
318 Kth largest sum continuous subarrays GeeksForGeeks 0 0 0 -
319 Leetcode- reorganize strings LeetCode 0 0 0 -
320 Merge “K” Sorted Linked Lists [V.IMP] GeeksForGeeks 0 0 0 -
321 Smallest range in “K” Lists GeeksForGeeks 0 0 0 -
322 Median in a stream of Integers GeeksForGeeks 0 0 0 -
323 Check if a Binary Tree is Heap GeeksForGeeks 0 0 0 -
324 Connect “n” ropes with minimum cost GeeksForGeeks 0 0 0 -
325 Convert BST to Min Heap GeeksForGeeks 0 0 0 -
326 Convert min heap to max heap GeeksForGeeks 0 0 0 -
327 Rearrange characters in a string such that no two adjacent are same GeeksForGeeks 0 0 0 -
328 Minimum sum of two numbers formed from digits of an array GeeksForGeeks 0 0 0 -

Graph

S. No. Problem Reference C++ Java Python Other languages
329 Create a Graph, print it OneDrive 0 0 0 -
330 Implement BFS algorithm GeeksForGeeks 0 0 0 -
331 Implement DFS Algo GeeksForGeeks 0 0 0 -
332 Detect Cycle in Directed Graph using BFS/DFS Algo GeeksForGeeks 0 0 0 -
333 Detect Cycle in UnDirected Graph using BFS/DFS Algo GeeksForGeeks 0 0 0 -
334 Search in a Maze GeeksForGeeks 0 0 0 -
335 Minimum Step by Knight GeeksForGeeks 0 0 0 -
336 Flood fill algo LeetCode 0 0 0 -
337 Clone a graph GeeksForGeeks 0 0 0 -
338 Making wired Connections LeetCode 0 0 0 -
339 Word Ladder LeetCode 0 0 0 -
340 Dijkstra algo GeeksForGeeks 0 0 0 -
341 Implement Topological Sort GeeksForGeeks 0 0 0 -
342 Minimum time taken by each job to be completed given by a Directed Acyclic Graph GeeksForGeeks 0 0 0 -
343 Find whether it is possible to finish all tasks or not from given dependencies GeeksForGeeks 0 0 0 -
344 Find the no. of Islands GeeksForGeeks 0 0 0 -
345 Given a sorted Dictionary of an Alien Language, find order of characters GeeksForGeeks 0 0 0 -
346 Implement Kruksal’sAlgorithm GeeksForGeeks 0 0 0 -
347 Implement Prim’s Algorithm GeeksForGeeks 0 0 0 -
348 Total no. of Spanning tree in a graph GeeksForGeeks 0 0 0 -
349 Implement Bellman Ford Algorithm GeeksForGeeks 0 0 0 -
350 Implement Floyd warshall Algorithm GeeksForGeeks 0 0 0 -
351 Travelling Salesman Problem GeeksForGeeks 0 0 0 -
352 Graph ColouringProblem GeeksForGeeks 0 0 0 -
353 Snake and Ladders Problem GeeksForGeeks 0 0 0 -
354 Find bridge in a graph GeeksForGeeks 0 0 0 -
355 Count Strongly connected Components(Kosaraju Algo) GeeksForGeeks 0 0 0 -
356 Check whether a graph is Bipartite or Not GeeksForGeeks 0 0 0 -
357 Detect Negative cycle in a graph GeeksForGeeks 0 0 0 -
358 Longest path in a Directed Acyclic Graph GeeksForGeeks 0 0 0 -
359 Journey to the Moon HackerRank 0 0 0 -
360 Cheapest Flights Within K Stops LeetCode 0 0 0 -
361 Oliver and the Game HackerEarth 0 0 0 -
362 Water Jug problem using BFS GeeksForGeeks 0 0 0 -
363 Water Jug problem using DFS GeeksForGeeks 0 0 0 -
364 Find if there is a path of more thank length from a source GeeksForGeeks 0 0 0 -
365 M-ColouringProblem GeeksForGeeks 0 0 0 -
366 Minimum edges to reverse o make path from source to destination GeeksForGeeks 0 0 0 -
367 Paths to travel each nodes using each edge(Seven Bridges) GeeksForGeeks 0 0 0 -
368 Vertex Cover Problem GeeksForGeeks 0 0 0 -
369 Chinese Postman or Route Inspection GeeksForGeeks 0 0 0 -
370 Number of Triangles in a Directed and Undirected Graph GeeksForGeeks 0 0 0 -
371 Minimise the cashflow among a given set of friends who have borrowed money from each other GeeksForGeeks 0 0 0 -
372 Two Clique Problem GeeksForGeeks 0 0 0 -

Trie

S. No. Problem Reference C++ Java Python Other languages
373 Construct a trie from scratch GeeksForGeeks 0 0 0 -
374 Find shortest unique prefix for every word in a given list GeeksForGeeks 0 0 0 -
375 Word Break Problem - (Trie solution) GeeksForGeeks 0 0 0 -
376 Given a sequence of words, print all anagrams together GeeksForGeeks 0 0 0 -
377 Implement a Phone Directory GeeksForGeeks 0 0 0 -
378 Print unique rows in a given boolean matrix GeeksForGeeks 0 0 0 -

Dynamic Programming

S. No. Problem Reference C++ Java Python Other languages
379 Coin ChangeProblem GeeksForGeeks 0 0 0 -
380 Knapsack Problem GeeksForGeeks 0 0 0 -
381 Binomial CoefficientProblem GeeksForGeeks 0 0 0 -
382 Permutation CoefficientProblem GeeksForGeeks 0 0 0 -
383 Program for nth Catalan Number GeeksForGeeks 0 0 0 -
384 Matrix Chain Multiplication GeeksForGeeks 0 0 0 -
385 Edit Distance GeeksForGeeks 0 0 0 -
386 Subset Sum Problem GeeksForGeeks 0 0 0 -
387 Friends Pairing Problem GeeksForGeeks 0 0 0 -
388 Gold Mine Problem GeeksForGeeks 0 0 0 -
389 Assembly Line SchedulingProblem GeeksForGeeks 0 0 0 -
390 Painting the Fence problem GeeksForGeeks 0 0 0 -
391 Maximize The Cut Segments GeeksForGeeks 0 0 0 -
392 Longest Common Subsequence GeeksForGeeks 0 0 0 -
393 Longest Repeated Subsequence GeeksForGeeks 0 0 0 -
394 Longest Increasing Subsequence GeeksForGeeks 0 0 0 -
395 Space Optimized Solution of LCS GeeksForGeeks 0 0 0 -
396 LCS (Longest Common Subsequence) of three strings GeeksForGeeks 0 0 0 -
397 Maximum Sum Increasing Subsequence GeeksForGeeks 0 0 0 -
398 Count all subsequences having product less than K GeeksForGeeks 0 0 0 -
399 Longest subsequence such that difference between adjacent is one GeeksForGeeks 0 0 0 -
400 Maximum subsequence sum such that no three are consecutive GeeksForGeeks 0 0 0 -
401 Egg Dropping Problem GeeksForGeeks 0 0 0 -
402 Maximum Length Chain of Pairs GeeksForGeeks 0 0 0 -
403 Maximum size square sub-matrix with all 1s GeeksForGeeks 0 0 0 -
404 Maximum sum of pairs with specific difference GeeksForGeeks 0 0 0 -
405 Min Cost PathProblem GeeksForGeeks 0 0 0 -
406 Maximum difference of zeros and ones in binary string GeeksForGeeks 0 0 0 -
407 Minimum number of jumps to reach end GeeksForGeeks 0 0 0 -
408 Minimum cost to fill given weight in a bag GeeksForGeeks 0 0 0 -
409 Minimum removals from array to make max –min <= K GeeksForGeeks 0 0 0 -
410 Longest Common Substring GeeksForGeeks 0 0 0 -
411 Count number of ways to reach a given score in a game GeeksForGeeks 0 0 0 -
412 Count Balanced Binary Trees of Height h GeeksForGeeks 0 0 0 -
413 LargestSum Contiguous Subarray [V>V>V>V IMP ] GeeksForGeeks 0 0 0 -
414 Smallest sum contiguous subarray GeeksForGeeks 0 0 0 -
415 Unbounded Knapsack (Repetition of items allowed) GeeksForGeeks 0 0 0 -
416 Word Break Problem GeeksForGeeks 0 0 0 -
417 Largest Independent Set Problem GeeksForGeeks 0 0 0 -
418 Partition problem GeeksForGeeks 0 0 0 -
419 Longest Palindromic Subsequence GeeksForGeeks 0 0 0 -
420 Count All Palindromic Subsequence in a given String GeeksForGeeks 0 0 0 -
421 Longest Palindromic Substring LeetCode 0 0 0 -
422 Longest alternating subsequence GeeksForGeeks 0 0 0 -
423 Weighted Job Scheduling GeeksForGeeks 0 0 0 -
424 Coin game winner where every player has three choices GeeksForGeeks 0 0 0 -
425 Count Derangements (Permutation such that no element appears in its original position) [ IMPORTANT ] GeeksForGeeks 0 0 0 -
426 Maximum profit by buying and selling a share at most twice [ IMP ] GeeksForGeeks 0 0 0 -
427 Optimal Strategy for a Game GeeksForGeeks 0 0 0 -
428 Optimal Binary Search Tree GeeksForGeeks 0 0 0 -
429 Palindrome PartitioningProblem GeeksForGeeks 0 0 0 -
430 Word Wrap Problem GeeksForGeeks 0 0 0 -
431 Mobile Numeric Keypad Problem [ IMP ] GeeksForGeeks 0 0 0 -
432 Boolean Parenthesization Problem GeeksForGeeks 0 0 0 -
433 Largest rectangular sub-matrix whose sum is 0 GeeksForGeeks 0 0 0 -
434 Largest area rectangular sub-matrix with equal number of 1’s and 0’s [ IMP ] GeeksForGeeks 0 0 0 -
435 Maximum sum rectangle in a 2D matrix GeeksForGeeks 0 0 0 -
436 Maximum profit by buying and selling a share at most k times GeeksForGeeks 0 0 0 -
437 Find if a string is interleaved of two other strings GeeksForGeeks 0 0 0 -
438 Maximum Length of Pair Chain LeetCode 0 0 0 -

Bit Manipulation

S. No. Problem Reference C++ Java Python Other languages
439 Count set bits in an integer GeeksForGeeks 0 0 0 -
440 Find the two non-repeating elements in an array of repeating elements GeeksForGeeks 0 0 0 -
441 Count number of bits to be flipped to convert A to B GeeksForGeeks 0 0 0 -
442 Count total set bits in all numbers from 1 to n GeeksForGeeks 0 0 0 -
443 Program to find whether a no is power of two GeeksForGeeks 0 0 0 -
444 Find position of the only set bit GeeksForGeeks 0 0 0 -
445 Copy set bits in a range GeeksForGeeks 0 0 0 -
446 Divide two integers without using multiplication, division and mod operator GeeksForGeeks 0 0 0 -
447 Calculate square of a number without using * or / or pow() GeeksForGeeks 0 0 0 -
448 Power Set GeeksForGeeks 0 0 0 -

Contributors

Contributing Guidelines

Please look here.

Releases

No releases published

Packages

No packages published

Languages