🪐 Leetcode DS & Algo Resources
Open in Telegram
Discuss here 😌👉 @leetcoded_discuss What will be shared here ? 😃👇 - Tons of coding resources ❤️ - Interview Experience of people - Trending Coding News - Crack FAANG💪 #compulsory for CS/IT students !! Buy 6 months Linkedin Premium 👉 @dishu_disha
Show moreThe country is not specifiedThe category is not specified
1 091
Subscribers
+824 hours
+427 days
+23630 days
Posts Archive
List of some frequently asked DSA questions.
Part 1- Array - https://lnkd.in/gnANUg_4
Part 2 Array - https://lnkd.in/gaxuYPev
Part 3- LinkedList - https://lnkd.in/gtXpMe_Z
Part 4- Linkedlist- https://lnkd.in/gF2rRzvv
Part 5 -String - https://lnkd.in/g84JNUAF
Part 6- Two pointers- https://lnkd.in/gS77cMZV
Part7- Hashing - https://lnkd.in/gcA83MhC
Part 8- Greedy -https://lnkd.in/ggyfDY7V
Part 9- Recursion - https://lnkd.in/gaesKYMR
Part- 10 - Backtracking - https://lnkd.in/g7PugW_w
Part -11 - Binary Search- https://lnkd.in/gpcKWV7Z
Maintain consistency solve atleast 3-4 problems everyday, don’t lose hope.
Happy Coding!🌝
𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 𝐀𝐥𝐥 𝐏𝐚𝐭𝐭𝐞𝐫𝐧𝐬.
Pattern ->𝟏𝐃 𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠
1) Climbing Stairs
2) Frog Jump
3) Frog Jump with K
4) Maximum sum of Non-adjacent elements
5) House robber 2
6) Ninja's Training
Pattern -> 𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 𝐎𝐧 𝐆𝐫𝐢𝐝𝐬 / 𝟐𝐃
1) Grid Unique Paths
2) Unique Paths
3) Minimum path sum in Grid
4) Tringle (Fixed Starting Point and Variable Ending Point)
5) Minimum/Maximum Falling Path Sum
6) Cherry Pickup 2
Pattern -> 𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 𝐎𝐧 𝐒𝐮𝐛𝐬𝐞𝐭𝐬 / 𝐒𝐮𝐛𝐬𝐞𝐪𝐮𝐞𝐧𝐜𝐞
1) Subset Sum Equals to Target
2) Partition Equals Subset Sum
3) Partition A subset into 2 subset with minimum absolute sum diff.
4) Count Subsets With Sum K
5) Count Partitions with given difference
6) 0/1 Knapsack
7) Minimum Coins
8) Target Sum
9) Coin Change 2
10) Unbounded Knapsack 1 D array
11) Rod Cutting 1 D array
Pattern -> 𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 𝐎𝐧 𝐒𝐭𝐫𝐢𝐧𝐠𝐬
1) Print Length Of Longest Common Subsequence
2) Print Longest Common Subsequence
3) Longest Palindromic Subsequence
4) Minimum Insertion to Make String Palindrome
5) Minimum Insertions/Deletions to Convert String A -> B
6) Shortest Common SuperSequence
7) Distinct Subsequence
8) Edit Distance
9) Wildcard Matching
Pattern -> 𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 𝐎𝐧 𝐒𝐭𝐨𝐜𝐤𝐬
1) Best Time To Buy and Sell Stock (Buy Ones & Sell Ones )
1) Best Time To Buy and Sell Stock 2 (Unlimited Time Buy & Sell)
1) Best Time To Buy and Sell Stock 3 ( At Max 2 Times Buy & Sell)
1) Best Time To Buy and Sell Stock 4 (K times Buy & Sell )
1) Best Time To Buy and Sell Stock 5 (Buy & Sell With Cooldown)
1) Best Time To Buy and Sell Stock 6 (Buy & Sell With Extra Fee)
Pattern -> 𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 𝐎𝐧 𝐋𝐨𝐧𝐠𝐞𝐬𝐭 𝐈𝐧𝐜𝐫𝐞𝐚𝐬𝐢𝐧𝐠 𝐒𝐮𝐛𝐬𝐞𝐪𝐮𝐞𝐧𝐜𝐞 (LIS)
1) Print Length Of Longest Increasing Subsequence
2) Print Longest Increasing Subsequence
3) Largest Divisible Subset
4) Longest String chain
5) Longest Bitonic Subsequence
6) Number Of Longest Increasing Subsequence
Pattern -> 𝐇𝐚𝐫𝐝𝐞𝐬𝐭 𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 𝐎𝐧 𝐩𝐚𝐫𝐭𝐢𝐭𝐢𝐨𝐧
1) Matrix Chain Multiplication
2) Minimum Cost To cut The Stick
3) Burst Balloons
4) Evaluate Boolean
5) Palindrome Partitioning 2
6) Partition Array For Maximum Sum
7) Maximum Rectangle Area with all 1's (Dp on Rectangle)
8) Count Square Submatrices with all ones (Dp on Rectangle)
Complete JAVA Resources.
https://drive.google.com/drive/folders/1IP7B7lhrRq6et72RGUVeLibe8yfvnq9i
Especially to crack Amazon.
https://docs.google.com/document/d/1FSa4mtlmk-2KMS7VniZ3_YjlbXL12QWbuLgVJQduHhY/mobilebasic
𝐆𝐑𝐀𝐏𝐇 𝐃𝐚𝐭𝐚𝐒𝐭𝐫𝐮𝐜𝐭𝐮𝐫𝐞 𝐑𝐨𝐚𝐝𝐌𝐚𝐩!
Day 1
Understand Graphs
Understand all three Graph representations and do hands-on
- Edge list
- Adjacency Matrix
- Adjacency List
Read and Understand Different Types of Graphs
-- Directed Graphs
-- Weighted Graphs etc
Day 2
Breadth-first search (BFS)
Depth-first search (DFS)
Day 3
Dijkstra - The shorter path from a given node to all vertices
Floyd Warshall - The shorter path from every vertex to every other vertex
Day 4
Prims - Minimum spanning tree
Kruskal - Minimum spanning tree
Day 5
Topological sort
Articulation points in a graph
Bridges in a graph
Johnsons algorithm
Day 6
Clone Graph - Leetcode 133
Number of Islands -- Leetcode 200
Course Schedule -- Leetcode 207
Day 7
Valid path -- Leetcode 1391
Is Graph Bipartite? -- Leetcode 785
Smallest multiple with 0 & 1
Day 8
Commutable islands
Detect cycle in Directed and Undirected Graph
Black shapes
Day 9
Knight on chessboard
Word ladder I
Word ladder II
Day 10
Smallest sequence with given primes
Capture regions on board
Word search board
Important Graph Algos:
DFS/BFS
Topology sort (Kahn's Algorithm)
Cycle detection techniques
Component of graphs
Bipartite
Kruskal algorithm (Minimum spanning tree)
Dijkstra algorithm (will not work for negative cycle)
Bellman's ford Algorithm
Floyd's warshall algorithm
Prim's Algorithm
Advance Graph Theory
Tarjan Algorithm
Some more.
Data structures in real-time applications.
𝐒𝐭𝐚𝐜𝐤:
1) UNDO option
2) Text editor: you push letter by letter to the stack so you erase back.
3) Recursion(inbuilt stack)
𝐐𝐮𝐞𝐮𝐞:
1) Your browser deletes the history past one month.
2) If you delete a picture on your phone, it will be the "recently delete" folder which says "the images will be deleted permanently after one week".
Here all the images are stored in the queue so it's easier to pop from the rear based on the image deletion date.
3) Waiting list: during online registrations, sometimes you'll be put on the waiting list. basically, all the requests will be stored in the queue.
𝐋𝐢𝐧𝐤𝐞𝐝 𝐥𝐢𝐬𝐭:
1) Browser's Next and Previous Button: a linked list of URLs
2) music player where you can play the next or previous song. (Doubly linked list).
3) In the ludo game, It has to pass the chance to each player in a circular fashion (circular linked list).
𝐓𝐫𝐞𝐞𝐬:
1) File system: Folders and subfolders (N-ary tree).
2) e-commerce websites : category -> subcategories -> products
3) Auto-suggestion when you google (Trie)
𝐆𝐫𝐚𝐩𝐡𝐬:
1) Uber, Ola cab booking: show nearest available cars (BFS)
2) Maven dependencies build order ( Topological sorting (DFS))
3) While booking bus/flights, you get a list of available routes.
4) In Facebook, users are considered to be the vertices and if they are friends then there is an edge running between them. Facebook’s Friend suggestion algorithm uses graph theory. Facebook is an example of an undirected graph.
𝐓𝐑𝐄𝐄 𝐃𝐚𝐭𝐚 𝐒𝐭𝐫𝐮𝐜𝐭𝐮𝐫𝐞 𝐑𝐨𝐚𝐝𝐌𝐚𝐩
Day 1
Read the theory of Binary Trees and different types of Binary Trees
Understand the Node structure of Binary Tree
Understand and Write Iterative code for following
Level Order Traversal
Inorder Traversal - Leetcode 194
Preorder Traversal
Postorder Traversal
Zig Zag Level Oder Traversal
Day 2
Implement Binary Tree
Add Node
Remove Node
Traverse Node
Construct Binary Tree from Inorder and PostOrder - Leetcode 105
Day 3
Same Tree - Leetcode 100
Invert Binary Tree - Leetcode 226
Symmetric Binary Tree - Leetcode 101
Left/Bottom/Top View of Binary Tree
Vertical Order Traversal of a Binary Tree - Leetcode 987
Day 4
Maximum Width of Binary Tree - Leetcode 622
Maximum Depth of Binary Tree - Leetcode 104
Diameter of Binary Tree - Leetcode 543
Balanced Binary Tree - Leetcode 110
Lowest Common Ancestor of a Binary Tree - Leetcode 236
Day 5
Identify Path to given Node
Binary Tree Maximum Path Sum - Leetcode 124
Flatten Binary Tree to Linked List - Leetcode 1114
Mirror Binary Tree
Serialize and Deserialize Binary Tree - Leetcode 297
Vertical Sum of Nodes in Binary Tree
Day 6
Understand Binary Search Tree
Search an Element in BST - Leetcode 700
Understand the Complexity of searching in BST
Lowest Common Ancestor of a given node in BST - Leetcode 235
Convert Sorted Array to Binary Search Tree - Leetcode 108
Validate Binary Search Tree - Leetcode 98
Day 7
Construct BST from Preorder Traversal - Leetcode 1008
Recover BST - Leetcode 99
Identify Predecessor and Successor of of a Node in BST
Kth Smallest Element in a BST
Two Sum - Input is BST - Leetcode 653
Day 8
Understand Self-Balancing Binary Search Trees
Read and Understand Red Black Tree
Read and Understand AVL Tree
Day 9
Understand Quadtrees and N-Ary Trees
Understand Trie Data Structure
Implement Trie (Prefix Tree)
Day 10
Maximum XOR of Two Numbers in an Array - Leetcode 421
Maximum XOR With an Element From Array - Leetcode 1707
Hotel Reviews - InterviewBit
