-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrograms Completed.txt
More file actions
388 lines (344 loc) · 11.7 KB
/
Programs Completed.txt
File metadata and controls
388 lines (344 loc) · 11.7 KB
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
[1] - Into to programming -
1) Basic Into to programming and Fundamentals - Conditional & Looping Statement, Break & Continue, Functions, Pointers
2) digit sum -
3) Reverse Number -
4) Prime no. -
5) Nested Loops & Patterns -
5.2) Star Pattern
5.3) Inverted Star Pattern
5.4) half Pyramid Pattern
5.5) Character Pyramid Pattern
5.6) Hollow Rectangle Pattern
5.7) Inverted & Rotated Half Pyramid
5.8) Floyd's Triangle
5.9) Diamond Pattern
5.10) Butterfly Pattern
6) Number System -
6.1) Binary to Decimal Conversion -
6.2) Decimal to Binary -
// -------------------
[2] - Arrays-
1)Initiation Methods of an array and Output & input of an array -
2) Largest Value/Max Element in the array & 2.1) Min Element -
3) Dereferences of Pointer concept in Array -
4) Linear Search in array -
5) Reverse an array -
5.1) using extra space
5.2 - W/o using Extra Space1 - 2 POINTERS APPROACH
6) Binary Search - It always for the Sorted Array
7) Array Pointer -
7.1. Pointer Arithmetic Approaches -
7.2 - Addition & Subtraction of Constants -
7.3- Addition & Subtraction of Pointers
7.4 - Comparison Operators
8) Subarrays -
9) Max Subarray Sum -
9.1 - Clearly Brute Force Approach -
9.2 - Slightly Optimized approach - for decreasing the time complexity
9.3 - Using Most Optimized Approach - Kadane's Algorithms. For very less Time Complexity
10) buy & sell stock problem-
11) Trapping Rainwater Problem -
// -------------------
[3] - Sorting Algorithms -
1) Bubble Sort Algo -
2) Selection Sort Implementation -
3) Insertion Sort Algorithm & Inbuilt Sorting technique -
4) Counting Sort
// -------------------
[4] - Matrix in CPP –
1) 2D Array Basic Introduction & Input, Output
2) Spiral matrix -
3) Diagonal Sum of Matrix -
4) Search for targeted element in Sorted Matrix -
4.1) - Brute Force Approach - most simple method. T.C - O(n*m)
4.2) - Using Binary Search - 2nd Optimum - Row Wise - O(n*logn), Colm Wise - O(m*logn)
4.3) - Staircase Search technique - O(n+m)
// -------------------
[5] - Character Array & Strings in CPP –
1) Intro to Char Array –
2) Covert to Upper Letter -
3) Reverse a Char Array -
4) Valid Palindrome in char array -
5) Char Array(String) Functions -
6)String Intro & Basic I/p, o/p operations - 6.1) String Member Functions-
7) Check the two strings are Anagram or not -
// -------------------
[6] - STL - Vector
1) Pair_Sum - FInd if any pair in Sorted Array has target sum
1.1) Brute Forece Approach - using Nested Loops. TC - O(n^2)
1.3) Uisng Linear Approach - 2 Pointer Approach. TC - O(n)
// -------------------
[7] Bit Manipulations –
1)Bitwise Operators -
2) Check if even or odd -
3) Get ith Bit of a num -
4) Set ith Bit - (sets the value to 1) -
5)Clr ith Bit - (sets the value to 0)
6) No. is power of 2 -
7) Count of Set Bits -
8) Fast Exponentiation -
// -------------------
[8] OOP’s in CPP –
1) Classes & Object basic Intro -
1.1) Access Modifiers
1.2) Getters & Setters -
2) Encapsulations -
2.1) This Constrcutor
2.2) Types of Cosntrcutrs -
2.3) Copy Constructor Conceppt -
2.4) Shallo & Deep Copy -
3) Destructor -
4) Inheritance -
4.1) Mode of Inharitance -
4.2) types of Inheritance -
4.2.1) Single Inheritance -
4.2.2) Multi-Level Inheritance -
4.2.3) Multiple Inheritance -
4.2.4) Hierarchical Inheritance -
4.2.5) Hybrid Inheroitance -
5) Polymorphism -
5.1) Compiletime Polymorphism -
5.1.1) Function Overloading -
5.1.2) Function Overloading -
5.2)Polymorphism -
5.2.1)Function Overriding -
5.2.2)Virtual Functions -
6) Abstraction -
7) Static Keyword -
8) Friend Class & Friend Function -
// -------------------
[9] Recursion –
1)Recursion Basic Understanding-
2)Recursion QUns -
2.1) Print the numbers in descending Order
2.2) Stack Overflow -
2.3)Sum of N-Natural Nmbers -
2.4) Print Nth Fibonacci Number -
2.5) Check if Array is Sorted or Not -
2.6) First OCcurence -
2.6.1) Last OCcurence -
2.7) X to the power N -
3) Tiling problem
4) Remove Duplicates from the String -
5) Friends Pairing Problem -
6) Binary String Problm -
// -------------------
[10] Divide & Conquer –
1) Merge Sort Algo -
2) Quick Sort Algorithm -
2.1) Quick Sort Worst Case Scenario -
3) Searching In Rotated Array Problem -
// -------------------
[12] Backtracking -
1) Backtracking In Arrays -
2) Find Subsets/Substrings -
3) Find Permutations -
4) N_Quee problem -
5) GridWays Problem -
6) SudokuSOlver -
// -------------------
[13] Greedy Algorithms
1) Activity Selection Problem -
2) Pair in C++ : STL container to store 2 objects -
3) Fractional Knapsack Problem -
4) Minimum Absolute DIfferent Pairs -
5) Maximum Chain Length of Pairs -
6) Indian Coins Problem -
7) Job Sequencing Problem -
// -------------------
[14] Linked List –
1) Linked List Introduction & Creation -
1.2) Deletion in LL -
2) Iterative Search in LL -
2.2) Recursive Search in LL -
3) Reverse a LinkedList -
4) Find & Remove Nth Node from LL -
5) Floyd's Cycle FInding Algorithm - Detect a Cycle/Loop in LL
5.1) Remove a cycle from LL -
6) LL using STL in CPP -
7) Merge Sort Implemetation on Linked List -
8) Zig-Zag LL - Alternate Nodes in LL -
9) DoublyLinkedList Concept -
// -------------------
[15] Stack -
1) Stack Implementation using Vector -
1.1) Stack implemtation for any type of Datatype
2) Stack impmentation usig LL -
Case 1 - using STL LL -
Case 2 - By creating LL manually -
3) Stack in STL -
4) Push at Bottom of the Stack -
5) Reverse a string using stack -
6) Reverse a stack using recursion -
7) Stock Spain Problem -
8) Next Greater Element -
9) Valid Paranthesis Problem -
10) Duplicate Paranthesis Problem -
11) Max Area in the Histogram -
// -------------------
[16] Queue -
1) Queue Implementation using LL: -
2) STL Queue Functionality -
3) Queue using 2 stacks -
3.1) Stack using 2 Queues -
4) First Non-Repeating Letter -
5) Interleave of 2 Queues -
6) Reverse a Queue -
7) Deque[Double Ended Queue] concept in Queue -
7.1) Queue using Deque -
7.2) Stack using Deque -
8) Circular Queue Implementations using Array -
// -------------------
[17] Binary Tree –
0) Intro to Binary Search -
1) Creating Binary Tree through Pre Ordder Traversal -
2) Tree Traversal techniques -
2.1) Pre Order Traversal -
2.2) IN Order Traversal-
2.3) Post Order Traversal-
2.4) Level Order Traversal -
2.4.1) - Modification in Level Order Traversal - Pushing all elements Level Wise in Output
3) Height of a Tree -
4) Count of Nodes in a Tree -
5) Sum of Nodes in a Tree -
6) Check from Root to asked Node if the path exist or not ?
7) Diameter of a tree - inn O(N^2)
7.1) Diameter of a tree - in O(N)
8) Subtree of ANother Tree -
9) Map in Cpp -
10) Top view of a Tree -
11) Bottom view of a Tree -
12) Kth Level of a Tree -
12.1 - using Iterative Level Order Method -
12.2) - Using Rrecursion - recurively searching approach for kth level
13) Lowest Common Ancestor - using fundamental approach - where TC - O(n) & Sc- O(n)
13.1) - Optimized appraoch fro SC - O(1)
14) Min. Distance between Nodes -
15) Kth Ancestor of Node -
16) Transform to Sum Tree -
// -------------------
[18] Binary Search Tree -
0) Intro to BST
1) Build BST from nodes -
2) Search in a BST -
3) Deletion of a Node in BST -
4) Print in a Range -
5) Root to leaf Path -
6) Validate BST -
7) Sorted nodes to Balanced BST -
8) Convert BSt to Balanced BST -
9) Size of Largest BSt in BT -
10) Merge 2 BST's -
// -------------------
[19] Priority Queue & Heap
1) Priority Queue Introduction -
2) Complete Binary Tree -
2.1) Heap Data Structure Max/Min-
2.1.1) Implementation of Max Heap -
2.1.2) Implementation of Max Heap -
3) Priority Queue For Pair/Objects -
3.1) Priority_Queue for Objects -
3.2) Using Priority Queue for Creating Pairs -
4) Heap Sort & its implemetations -
5) Quns Based on Priority_Queue and Heap -
5.1) Nearby K Cars -
5.2) Connect N Ropes -
5.3) Weakest Soldier -
5.4) Sliding Window Maximum -
// -------------------
[20] Hashing –
1) Hashmap Data Structures using Hash Table Implementation -
2) STL COntainersMap - Unordered Map & Map -
2.1) Unordered Map Working -
2.2) Map Working -
3) STL COntainersMap - Unordered Set & Set -
3.1) Unorderd Set Working -
3.2) Set Working -
4) Quns using STL Containers -
4.1) Pair Sum/Two SUm/Target Sum -
4.2) Majority Element -
4.3) Valid Anagram -
4.4) Count Distinct -
4.5) Union & Interesection -
4.6) itinerary From Tickets -
4.7) Largest Subarray with sum 0 -
4.8) Count of Subarray sum Equals to K -
// -------------------
[21] Trie
1) Trie Intro -
2) Trie Quns -
2.1) Word Break Problem -
2.2) Prefix Problem -
2.3) StartWithProblem -
2.4) COunt Unique Substring -
2.5) Longest Word with all Prefix -
// -------------------
[22] Segment Trees –
1) Intro to Segment Trees : -
1.1) Creating a Segment Tree -
2) Performing QUeries in Segment Trees -
3) Update on any index in Segment Tree -
4) Max Segment Tree - in particular given range -
4.1) Creation & Query in Max Segment Tree -
4.2) Update in Range Max Segment Tree - in particular given range -
5) Range Min Segment Tree - Creation, Query & Update in particular given range -
// -------------------
[23] Graph -
0) Intro to Graph, Types of Graph & Methods for stroing a Graph –
1) Graph Creation -
2) Graph Traversal Techniques -
2.1) BFS Implementation on Graph -
2.2) DFS Implementation on Graph -
3) HasPath Problem -
3.1) Using DFS -
4) Diconneted Graph OR Disconnected Components -
4.1) using DFS Traversal -
4.2) using BFS Traversal -
5) Cycles in Graph -
5.1) Cycle Detection in an Undirected Graph - using DFS -
5.1.1) Cycle Detection in Directed Graph - using DFS -
6) Bipartite Gtaph -
7) All PAth Problem -
8) Topological Sorting -
8.1) Leetcode 207) Course Schedule Problem -
8.2) Leetcode 210) Course Schedule II -
9) Kahn's Algorithm (using BFS) -
9.1) Kahn's Algorithm For getting Cycles in Graph -
10) Dijkstra's ALgorithms -
11) Bellman Ford Algorithm -
12) Minimum SPanning Tree(MST) -
12.1) Prim's Algorithm -
12.2) - Leetcode 1584 - Min Cost to Connect All Points
13) Leetcode Qun 787 - Cheapest Flight Within K Stops -
14) Disjoint Set/UnionFind Data Structure -
15) Kruskal's ALgorithms -
16) Flood Fill ALgorithms - Leetcode Qun - 733 -
// -------------------
[24] Dynamic Programming OR Optimized Recursion Programming -
1) Overview for DP -, What is DP & When to use it -, Types of using DP -
2) DP Patterns using QUns -
2.1) Pattern - I : Fibonacci Pattern
2.1.1) CLimbing Stairs Problem -
Using Recurison Only -
Now using the DP using MEMOIZATION -
Now using the DP using TABULATION -
2.1.2) CLimbing Stairs Problem Variaation - When 3 jumps are allowed
2.2) Pattern - II : Knapsack Problem Pattern
2.2.1) - 0-1 Knapsack Problem - Using Recursion, 0-1 Knapsack Problem DP(using Memoization), 0-1 Knapsack Problem DP(using Tabulaiton) -
2.2.2) - Target Sum Subset - Tabulaiton Approach -
2.2.3) Minimum Partitioning - Using Tabulation Approach -
2.3) Pattern - III : Unbounded Knapsack -
2.3.1 - Leetcode 518 - Coin Change - II Coin Change Problem - Using Tabulation -
2.3.2 - ROd Cuttitng Problem - Using Tabulation Approach -
2.3.3 - Leetcode 1547 - Min cost to cut sticks
2.4) Pattern - IV : Longest Common Subsequence Problem Pattern -, Using Recursion, - Using Memoization, -Using Tabulation -
2.4.2) -Longest Common SUbstring -, Using Tabulation only -
2.4.3) -Longest Increasing Subsequence -
2.4.4) - Leetcode - 72) Edit Distance - using Tabulation Approach
2.4.5) - Leetcode - 44) WildCard Matching Problem - using Tabulation Approach -
2.5) Pattern - V : Catalan's Number -, 2.5.1) Catan's Number using Recursion -, Catan's Number using Memoization -, Catan's Number using Tabulation -
2.5.2) - Leetcodee - 96) Count BST's - FInd coutn of all possible structurally unique BSTs that can be forned with n nodes - using Tabulatoin -
2.5.3) - Mountain Ranges Problem -
2.6) Pattern - VI : Matric Chain Multiplication(MCM)
2.6.1) using Recursion -, using Memoization -, using Tabulation -
// -------------------