1750825030425
1750825030425
Questions
Arrays:
Find the missing number in an array of I to n
2. Kadane's Algorithm (Maximum subarray sum)
3. Find duplicate numbers in an array
4. Merge two sorted arrays without extra space
5. Rotate an array by K positions
6. Find all pairs in an array that sum up to a given number
7. Trapping Rain Water
8. Find the longest consecutive subsequence
9. Find the majority element
10. Best time to buy and sell stock
Il. Merge intervals
12. Next permutation of an array
13. Find the minimum number of platforms required for a train station
14. Maximum product subarray
15. Find subarray with given sum
16. Find median of two sorted arrays
17. Rearrange array elements alternately (maximum, minimum)
18. Find the largest element in an array Strings:
19. Check if two strings are anagrams
20. Longest common prefix
21. Check if a string is a palindrome
22. Z-algorithm (Pattern matching)
23. KMP Algorithm for pattern matching
24. Longest palindromic substring
25. Convert a string to an integer (Implement atoi)
26. Find the longest substring without repeating characters
27. Rabin-Karp algorithm
28. Roman to integer and vice versa
29. Group anagrams
30. Valid parentheses Linked Lists:
31. Reverse a linked list
32. Detect a cycle in a linked list
33. Merge two sorted linked lists
34. Find the intersection point of two linked lists
35. Remove N-th node from the end of the list
36. Flatten a multilevel doubly linked list
37. Add two numbers represented by linked lists
38. Clone a linked list with random pointers
39. Palindrome linked list
40. Rotate a linked list
Trees:
49. Inorder, Preorder, Postorder traversal of a binary tree
50. Level order traversal of a binary tree
51. Find the height of a binary tree
52. Check if a binary tree is balanced
53. Check if two trees are identical
54. Lowest common ancestor in a binary tree
55. Maximum path sum in a binary tree
56. Diameter of a binary tree
57. Check if a binary tree is a binary search tree
58. Convert a binary tree to a doubly linked list
59. Zig-zag traversal of a binary tree
60. Kth smallest/largest element in a binary search tree
61. Serialize and deserialize a binary tree
62. Flatten a binary tree to a linked list Heaps:
63. Kth largest element in an array
64. Merge K sorted arrays
65. Find the median from a data stream
66. Top K frequent elements
67. Minimum cost to connect all ropes
68. Sort a nearly sorted array Graphs:
69. Breadth-first search (BFS)
70. Depth-first search (DFS)
71. Detect a cycle in an undirected graph
72. Detect a cycle in a directed graph
73. Topological sort
74. Dijkstra's algorithm
75. Bellman-Ford algorithm
76. Kruskal's algorithm
77. Prim's algorithm
78. Floyd Warshall algorithm
79. Find whether a path exists between two nodes
80. Count the number of islands
Dynamic Programming:
81. 0/1 Knapsack problem
82. Longest common subsequence
83. Longest increasing subsequence
84. Edit distance
85. Coin change problem
86. Word break problem
87. Subset sum problem
88. Maximum product cutting
89. Rod cutting problem
90. Egg dropping problem
91. Minimum sum partition
92. Palindrome partitioning
93. Longest palindromic subsequence
94. Optimal binary search tree
95. Matrix chain multiplication
96. House robber problem
97. Paint house problem
Miscellaneous:
98. Find the first missing positive integer
99. Count inversions in an array 100. N-Queens problem