200 DSA Questions in JavaScript
Arrays
1. Find the maximum subarray sum.
2. Check if two arrays are equal.
3. Find the intersection of two arrays.
4. Rotate an array to the right by k steps.
5. Find the missing number in an array.
Strings
6. Reverse a string.
7. Check if a string is a palindrome.
8. Find the longest common prefix.
9. Count the occurrences of a character in a string.
10. Check if two strings are anagrams.
Linked Lists
11. Reverse a linked list.
12. Detect a cycle in a linked list.
13. Find the middle node of a linked list.
14. Merge two sorted linked lists.
15. Remove duplicates from a sorted linked list.
Stacks and Queues
16. Implement a stack using an array.
17. Implement a queue using a stack.
18. Evaluate a postfix expression.
19. Check if a string has balanced parentheses.
20. Find the next greater element.
Trees
21. Find the height of a binary tree.
22. Check if a tree is balanced.
23. Find the lowest common ancestor of two nodes.
24. Convert a binary tree to a linked list.
25. Perform inorder traversal of a binary tree.
Graphs
26. Implement depth-first search (DFS).
27. Implement breadth-first search (BFS).
28. Detect a cycle in a graph.
29. Find the shortest path in an unweighted graph.
30. Check if a graph is bipartite.
Sorting and Searching
31. Implement binary search.
32. Sort an array using quicksort.
33. Sort an array using mergesort.
34. Find the kth smallest element in an array.
35. Search for a target in a rotated sorted array.
Dynamic Programming
36. Find the nth Fibonacci number using DP.
37. Solve the 0/1 knapsack problem.
38. Find the longest increasing subsequence.
39. Find the minimum number of coins for change.
40. Solve the rod cutting problem.
Miscellaneous
41. Find the majority element in an array.
42. Find the missing number in an arithmetic sequence.
43. Check if a number is prime.
44. Generate all permutations of a string.
45. Implement a LRU cache.