-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTracker.txt
554 lines (350 loc) · 13.6 KB
/
Tracker.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
⦿ 𝗗𝗮𝘁𝗲 = 𝟮𝟲-𝗝𝘂𝗹𝘆-𝟮𝟬𝟮𝟰
🚩 Palindromic DP ..................
1. Palindromic Substrings.
2. Longest Palindromic Substring.
3. Longest Palindromic Subsequence.
4. Palindrome Partitioning - 1
5. Palindrome Partitioning - 2
⦿ 𝗗𝗮𝘁𝗲 = 𝟮7-𝗝𝘂𝗹𝘆-𝟮𝟬𝟮𝟰
🚩 Palindromic DP ..................
1. Sieve Algo (pow(x,n)).
2. minimum number of characters to be inserted to convert it to a palindrome.
⦿ 𝗗𝗮𝘁𝗲 = 𝟮8-𝗝𝘂𝗹𝘆-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. BFS of Graph
2. DFS of Graph
3. Number of Provinces.
4. Detect Cycle in Undirected Graph - (using BFS & DFS).
⦿ 𝗗𝗮𝘁𝗲 = 𝟮9-𝗝𝘂𝗹𝘆-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Topological Sort of Graph (DFS).
2. Kahn's Algorithms (Topological Sort - BFS).
3. Detect Cycle in Directed Graph - (using BFS & DFS).
⦿ 𝗗𝗮𝘁𝗲 = 30-𝗝𝘂𝗹𝘆-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Course Schedule-1
2. Course Schedule-2
3. Is Graph Bipartite?
⦿ 𝗗𝗮𝘁𝗲 = 31-𝗝𝘂𝗹𝘆-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. DSU (Disjoint Set Union).
2. Satisfiability of Equality Equations.
⦿ 𝗗𝗮𝘁𝗲 = 01-August-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Number of Operations to Make Network Connected.
2. Count Unreachable Pairs of Nodes in an Undirected Graph.
3. Dijkstra's Algorithm | PART-1 (Using Priority Queue).
4. Dijkstra's Algorithm | PART-2 (Using Set).
5. Network Delay Time.
⦿ 𝗗𝗮𝘁𝗲 = 02-August-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Bellman Ford Algorithms.
2. Floyd Warshall Algorithms.
3. Minimum Spanning Tree.
4. Prim's Algoritms for finding MST.
⦿ 𝗗𝗮𝘁𝗲 = 03-August-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Kruskal's Algorithm | Minimum Spanning Tree.
⦿ 𝗗𝗮𝘁𝗲 = 04-August-𝟮𝟬𝟮𝟰
🚩 DP ..................
1. Climbing Stairs.
2. Fibonacchi number.
⦿ 𝗗𝗮𝘁𝗲 = 05-August-𝟮𝟬𝟮𝟰
🚩 DP ..................
1. Min Cost Climbing Stairs.
2. Frog Jump
3. House Robber - 1
4. House Robber - 2
⦿ 𝗗𝗮𝘁𝗲 = 06-August-𝟮𝟬𝟮𝟰
🚩 DP ..................
1. Buy and Sell Stock - 1
2. Buy and Sell Stock - 2
3. Buy and Sell Stock - 3
⦿ 𝗗𝗮𝘁𝗲 = 07-August-𝟮𝟬𝟮𝟰
🚩 DP ..................
1. Buy and Sell Stock - 4
2. Buy and Sell Stock - with cooldown
3. Buy and Sell Stock - with fee
⦿ 𝗗𝗮𝘁𝗲 = 08-August-𝟮𝟬𝟮𝟰
🚩 DP ..................
1. LCS (longest common subsequence)
2. Printing the LCS
⦿ 𝗗𝗮𝘁𝗲 = 09-August-𝟮𝟬𝟮𝟰
🚩 DP ..................
1. Longest Common Substring .
2. Longest Palindromic Subsequence.
3. Longest Palindromic Substring.
⦿ 𝗗𝗮𝘁𝗲 = 10-August-𝟮𝟬𝟮𝟰
🚩 DP ..................
1. Unique Path - 1
2. MCM (Matrix chain multiplication) - recursion + memoization...
3. Matrix Chain Multiplication (bottom up)
4. Minimum Cost to Cut a Stick.
⦿ 𝗗𝗮𝘁𝗲 = 11-August-𝟮𝟬𝟮𝟰
🚩 DP ..................
1. Minimum insertions to make string palindrome.
2. Minimum Insertions/Deletions to Convert String
⦿ 𝗗𝗮𝘁𝗲 = 12-August-𝟮𝟬𝟮𝟰
🚩 DP ..................
1. Shortest Common Supersequence.
2. LIS (longest increasing subsequence) using 2D dp - Recursion + memoization.
3. LIS (longest increasing subsequence) using 2D dp - tabulation + space optimization.
⦿ 𝗗𝗮𝘁𝗲 = 13-August-𝟮𝟬𝟮𝟰
🚩 DP ..................
1. LIS(longest increasing subseauence) using 1D Dp (tabulation only).
2. Printing Longest Increasing Subsequence using 1D Dp.
3. LIS (longest increasing subsequence) using Binary Search.
4. Number of Longest Increasing Subsequences.
⦿ 𝗗𝗮𝘁𝗲 = 14-August-𝟮𝟬𝟮𝟰
🚩 Recursion + DP ..................
1. Combinational Sum - 1
2. Combinational Sum - 2
3. Combinational Sum - 3
4. Combinational Sum - 4
⦿ 𝗗𝗮𝘁𝗲 = 15-August-𝟮𝟬𝟮𝟰
🚩 Linked List ..................
1. Reverse the Linked List.(both iterative & recursive).
2. Middle of the Linked List.(iterstive & recursive).
3. Check Palindrome - Linked List (iterstive & recursive).
4. Detect a loop in LL
5. Find the starting point in LL.
6. Length of Loop in LL
7. Segrregate odd and even nodes in LL.
8. Remove Nth node from the back of the LL
9. Delete the middle node of LL
10. Add 1 number given as Linked List.
⦿ 𝗗𝗮𝘁𝗲 = 16-August-𝟮𝟬𝟮𝟰
🚩 Linked List ..................
1. Add 2 numbers in LL
2. Merge 2 sorted LL (iterstive & recursive).
3. Sort LL (Merge Sort).
4. Sort a LL of 0's 1's and 2's by changing links
5. Find the intersection point of Y LL
6. Rotate a LL
7. Reverse LL in group of given size K
⦿ 𝗗𝗮𝘁𝗲 = 17-August-𝟮𝟬𝟮𝟰
🚩 Linked List ..................
1. Flattening of LL
2. Copy List with Random Pointer.
3. Merge K sorted Linked List
4. Reorder Linked List.
5. Remove Duplicates From Sorted List.
6. Remove Duplicates From UnSorted List
7. Insertion Sort List.
⦿ 𝗗𝗮𝘁𝗲 = 18-August-𝟮𝟬𝟮𝟰
🚩 Linked List ..................
1. Remove Linked List Elements.
2. LRU cache.
3. Insert Greatest Common Divisors in Linked List.
⦿ 𝗗𝗮𝘁𝗲 = 19-August-𝟮𝟬𝟮𝟰
🚩 Binary Tree ..................
1. InOrder Traversal (using recursion + one stack).
2. PreOrder Traversal (using recursion + one stack).
3. PostOrder Traversal (using recursion + one stack + two stack).
4. InOrder, PreOrder & PostOrder in a single Program.
5. Level order traversal.
6. Array to Binary Tree.
⦿ 𝗗𝗮𝘁𝗲 = 20-August-𝟮𝟬𝟮𝟰
🚩 Binary Tree ..................
1. Height of Binary Tree.
2. Check if the Binary tree is height-balanced or not.
3. Diameter of Binary Tree.
4. Maximum path sum.
5. Check if two trees are identical or not.
6. Zig-Zag Traversal of Binary Tree.
⦿ 𝗗𝗮𝘁𝗲 = 21-August-𝟮𝟬𝟮𝟰
🚩 Binary Tree ..................
1. Boundary Traversal of Binary Tree.
2. Vertical Order Traversal of Binary Tree.
3. Morris InOrder Traversal of Binary Tree.
4. Morris PreOrder Traversal of Binary Tree.
5. Morris PostOrder Traversal of Binary Tree.
⦿ 𝗗𝗮𝘁𝗲 = 22-August-𝟮𝟬𝟮𝟰
🚩 Binary Tree ..................
1. Top View of Binary Tree.
2. Bottom View of Binary Tree.
3. Left Side View of Binary Tree.
4. Right Side View of Binary Tree.
5. Symmetric Binary Tree.
𝗗𝗮𝘁𝗲 = 23-August-𝟮𝟬𝟮𝟰
🚩 Binary Tree ..................
1. LCA in Binary Tree.
2. Check Completeness of a Binary Tree.
3. Count total Nodes in a COMPLETE Binary Tree.
4. Check for Children Sum Property.
5. Path Sum (root to target).
𝗗𝗮𝘁𝗲 = 24-August-𝟮𝟬𝟮𝟰
🚩 Binary Tree ..................
1. Construct Binary Tree from inorder and preorder.
2. Construct the Binary Tree from Postorder and Inorder Traversal.
3. Serialize and deserialize Binary Tree.
4. Invert Binary Tree.
5. All Root to Leaf Paths In Binary Tree.
𝗗𝗮𝘁𝗲 = 25-August-𝟮𝟬𝟮𝟰
🚩 Binary Tree ..................
1. Maximum Width of a Binary Tree.
2. Flatten Binary Tree to Linked List.
3. Minimum time taken to BURN the Binary Tree from a Node.
4. Print all the Nodes at a distance of K in a Binary Tree.
𝗗𝗮𝘁𝗲 = 26-August-𝟮𝟬𝟮𝟰
🚩 Binary Search Tree ..................
1. Convert Sorted Array to Binary Search Tree.
2. Search in a Binary Search Tree.
3. Find Min/Max in BST.
4. Ceil in a Binary Search Tree.
5. LCA in Binary Search Tree.
𝗗𝗮𝘁𝗲 = 27-August-𝟮𝟬𝟮𝟰
🚩 Binary Search Tree ..................
1. Floor in a Binary Search Tree.
2. Insert into a Binary Search Tree.
3. Find K-th smallest element in BST.
4. Find K-th largest element in BST.
5. Check if a tree is a BST or BT or (Validate BST).
𝗗𝗮𝘁𝗲 = 28-August-𝟮𝟬𝟮𝟰
🚩 Binary Search Tree ..................
1. Construct a BST from a preorder traversal.
2. Inorder Predecessor in BST.
3. Inorder Successor in BST.
4. Merge 2 Binary Tree (very Easy).
5. Convert Binary Tree to BST without changing Structure of BT.
6. Merge 2 BST.
7. Two Sum In BST | Check if there exists a pair with Sum K.
8. Delete a Node in Binary Search Tree.
9. Recover BST | Correct BST with two nodes swapped.
10.Largest BST in Binary Tree.
𝗗𝗮𝘁𝗲 = 29-August-𝟮𝟬𝟮𝟰
🚩 Stack & Queues ..................
1. Implement Stack using Arrays.
2. Implement stack using linked list.
3. Implement stack using Single Queue.
4. Implement stack using 2 Queues.
5. Infix to Postfix Conversion using Stack.
6. Convert Infix To Prefix Notation.
7. Postfix to Infix.
8. Prefix to Infix Conversion.
9. Postfix to Prefix Conversion.
10.Prefix to Postfix Conversion.
𝗗𝗮𝘁𝗲 = 30-August-𝟮𝟬𝟮𝟰
🚩 Stack & Queues ..................
1. Check for balanced paranthesis.
2. Evaluate Reverse Polish Notation.
3. Implement Min Stack.
4. Next Greater Element.
5. Next Greater Element 2 (circular).
𝗗𝗮𝘁𝗲 = 31-August-𝟮𝟬𝟮𝟰
🚩 Stack & Queues ..................
1. Next Smaller Element.
2. Trapping Rainwater.
3. Asteroid Collision.
4. Sum of Subarray Minimums.
5. Sum of Subarray Ranges.(Extended version of Above Problem).
𝗗𝗮𝘁𝗲 = 1-September-𝟮𝟬𝟮𝟰
🚩 Stack & Queues ..................
1. Remove-k-digits From String to form minimum Number.
2. Largest Rectangle in Histogram.
3. 132 Pattern (prev grater element).
𝗗𝗮𝘁𝗲 = 2-September-𝟮𝟬𝟮𝟰
🚩 Arrays ..................
1. Largest/Smallest Element in an Array.
2. Second Largest/Smallest Element in an Array without sorting.
3. Check if the array is sorted.
4. Remove duplicates from Sorted array.
5. Left Rotate an array by one place.
6. Right rotate an array by one places.
7. Left Rotate an array by D place.
8. Right Rotate an array by D place.
9. Move Zeros to end.
10. Find the Union.
11. Find the Intersection.
12. Find missing number in an array.
13. Maximum Consecutive Ones.
14. Find the number that appears once, and other numbers twice.
15. Longest subarray with given sum K(positives).
16. Longest subarray with sum K (Positives + Negatives).
𝗗𝗮𝘁𝗲 = 3-September-𝟮𝟬𝟮𝟰
🚩 Arrays ..................
1. 2 - Sum.
2. Sort an array of 0's 1's and 2's.
3. Majority Element (>n/2 times) (Moore Voting Algorithm).
4. Kadane's Algorithm, maximum subarray sum.
5. Print subarray with maximum subarray sum (extended version of above problem).
6. Rearrange the array in alternating positive and negative items.
𝗗𝗮𝘁𝗲 = 4-September-𝟮𝟬𝟮𝟰
🚩 Arrays ..................
1. Generate All Permutations.
2. Next Permutation.
3. Leaders in an Array problem.
𝗗𝗮𝘁𝗲 = 5-September-𝟮𝟬𝟮𝟰
🚩 Arrays ..................
1. Longest Consecutive Sequence in an Array.
2. Set Matrix Zeros.
3. Rotate Matrix by 90 degrees clockwise.
4. Rotate matrix by 90 degree anticlockwise.
5. Rotate matrix by 180 degree.
𝗗𝗮𝘁𝗲 = 6-September-𝟮𝟬𝟮𝟰 to 𝗗𝗮𝘁𝗲 = 10-September-𝟮𝟬𝟮𝟰
(っ◔◡◔)っ ♥ Something Went Wrong ! ♥
𝗗𝗮𝘁𝗲 = 11-September-𝟮𝟬𝟮𝟰
🚩 Arrays ..................
1. Print the matrix in spiral manner (i)
2. 2-Sum
3. 3-Sum
4. 4-Sum
5. Majority Element (n/3 times).(Extended version of Moore Voting Algorithm)
𝗗𝗮𝘁𝗲 = 12-September-𝟮𝟬𝟮𝟰
🚩 Arrays ..................
1. Largest Subarray with 0 Sum.
2. Count number of subarrays with given xor K.
3. Merge two sorted arrays without extra space.
4. Maximum Product Subarray.
5. Find the repeating and missing number.
𝗗𝗮𝘁𝗲 = 13-September-𝟮𝟬𝟮𝟰
🚩 Arrays ..................
1. Pascal's Triangle.
2. Merge Overlapping Subintervals.
3. Count Inversions.
4. Reverse Pairs.
-------------------------------------------------------------------------------
.............................🤝 Revision 🤝...................................
-------------------------------------------------------------------------------
⦿ 𝗗𝗮𝘁𝗲 = 14-September-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Number of Islands
2. Max Area of Islands
3. Island Perimeter
4. Number of Closed Islands
5. Count Sub Islands
6. Flood fill
7. Number of Connected Components In An Undirected Graph.
⦿ 𝗗𝗮𝘁𝗲 = 15-September-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Find a Safe Walk Through a Grid.
2. Shortest Path in a Grid with Obstacles Elimination.
⦿ 𝗗𝗮𝘁𝗲 = 16-September-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Topo Sort.
2. Kahn's Algorithm.
3. Cycle Detection in Directed Graph (BFS). = using kahn's algo...
4. Cycle Detection in Directed Graph (DFS). = using path visited + visited.
5. Course Schedule - I
6. Course Schedule - II
⦿ 𝗗𝗮𝘁𝗲 = 17-September-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Cycle Detection in unirected Graph (bfs).
2. Cycle Detection in undirected Graph (dfs).
3. Surrounded Regions (dfs)
⦿ 𝗗𝗮𝘁𝗲 = 18-September-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Djisktra's Algorithm (using priority queue);
2. Djisktra's Algorithm (using priority set);
3. Shortest Path in UG with unit weights.
⦿ 𝗗𝗮𝘁𝗲 = 19-September-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Find Eventual Safe States.
2. Critical Connections in a Network
⦿ 𝗗𝗮𝘁𝗲 = 20-September-𝟮𝟬𝟮𝟰
🚩 Graph ..................
1. Is Graph Bipartite?
2. 0/1 Matrix
3. Number of Enclaves.
🚩🚩🚩🚩🚩 Something went Wrong .... 🚩🚩🚩🚩
Resume Shortly .......