👇👇 Top 50 Basic DSA Problems 👇👇
Completed: 0%
⭐Array:-
1: Find the maximum element in an array.
Hint
Solve
2: Find the minimum element in an array.
Hint
Solve
3: Calculate the sum of elements in an array.
Hint
Solve
4: Reverse an array.
Hint
Solve
5: Rotate an array to the right by k positions.
Hint
Solve
6: Check if an array is sorted.
Hint
Solve
7: Find the frequency of an element in an array.
Hint
Solve
8: Find the majority element in an array (if it exists).
Hint
Solve
9: Find the intersection of two arrays.
Hint
Solve
10: Merge two sorted arrays.
Hint
Solve
⭐String:-
11: Reverse a string.
Hint
Solve
12: Check if a string is a palindrome.
Hint
Solve
13: Find the longest substring without repeating characters.
Hint
Solve
14: Count the occurrences of a character in a string.
Hint
Solve
15: Check if two strings are anagrams of each other.
Hint
Solve
16: Implement a basic string compression algorithm.
Hint
Solve
17: Find the first non-repeating character in a string.
Hint
Solve
⭐Linked List:-
18: Implement a singly linked list.
Hint
Solve
19: Reverse a linked list.
Hint
Solve
20: Detect a cycle in a linked list.
Hint
Solve
21: Find the middle element of a linked list.
Hint
Solve
22: Merge two sorted linked lists.
Hint
Solve
23: Remove duplicates from a sorted linked list.
Hint
Solve
24: Add two numbers represented by linked lists.
Hint
Solve
⭐Stacks and Queues:-
25: Implement a stack using an array or linked list.
Hint
Solve
26: Implement a queue using an array or linked list.
Hint
Solve
27: Check for balanced parentheses using a stack.
Hint
Solve
28: Evaluate a postfix expression using a stack.
Hint
Solve
29: Implement min stack that supports finding min element in O(1) time.
Hint
Solve
⭐Searching and Sorting:-
30: Implement binary search in a sorted array.
Hint
Solve
31: Implement linear search in an unsorted array.
Hint
Solve
32: Implement bubble sort.
Hint
Solve
33: Implement selection sort.
Hint
Solve
34: Implement insertion sort.
Hint
Solve
35: Implement merge sort.
Hint
Solve
36: Implement quicksort.
Hint
Solve
⭐Trees:-
37: Implement a binary search tree (BST).
Hint
Solve
38: Perform an inorder traversal of a binary tree.
Hint
Solve
39: Perform a preorder traversal of a binary tree.
Hint
Solve
40: Perform a postorder traversal of a binary tree.
Hint
Solve
41: Check if a binary tree is a binary search tree (BST).
Hint
Solve
42: Find the height (depth) of a binary tree.
Hint
Solve
43: Find the lowest common ancestor (LCA) of two nodes in a binary tree.
Hint
Solve
44: Serialize and deserialize a binary tree.
Hint
Solve
⭐Graphs:-
45: Implement a graph using adjacency matrix or adjacency list.
Hint
Solve
46: Perform a depth-first search (DFS) on a graph.
Hint
Solve
47: Perform a breadth-first search (BFS) on a graph.
Hint
Solve
48: Find shortest path b/w two nodes in weighted graph (Dijkstra's alg.).
Hint
Solve
49: Find minimum spanning tree of graph (Prim's or Kruskal's algorithm).
Hint
Solve
50: Detect if a directed graph has a cycle (using DFS or topological sorting).
Hint
Solve