0% found this document useful (0 votes)
18 views

DSA Problems

Uploaded by

utubebhuvan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

DSA Problems

Uploaded by

utubebhuvan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Data Structures:

1. Arrays and Strings:


○ Find the largest/smallest element in an array.
○ Reverse an array or string.
○ Check for anagram or palindrome.
○ Find the maximum subarray sum (Kadane's Algorithm).
○ Search an element in a sorted and rotated array.
○ Merge two sorted arrays.
○ Find the intersection/union of two arrays.
2. Linked Lists:
○ Reverse a linked list.
○ Detect and remove a cycle in a linked list.
○ Find the middle of a linked list.
○ Merge two sorted linked lists.
○ Remove duplicates from a sorted/unsorted linked list.
○ Implement stack/queue using linked list.
3. Stacks and Queues:
○ Implement a stack/queue using arrays/linked lists.
○ Evaluate postfix/prefix expressions.
○ Implement a stack with getMin() in O(1) time.
○ Implement a circular queue.
○ Check for balanced parentheses in an expression.
4. Trees and Graphs:
○ Implement tree traversals (inorder, preorder, postorder).
○ Level order traversal of a tree.
○ Check if a binary tree is a BST.
○ Find the height/diameter of a tree.
○ Lowest Common Ancestor (LCA) in a binary tree.
○ Implement graph traversals (BFS, DFS).
○ Detect a cycle in a graph.
○ Shortest path algorithms (Dijkstra's, Bellman-Ford).
○ Minimum Spanning Tree (Kruskal's, Prim's).
5. Heaps:
○ Implement a min-heap/max-heap.
○ Find the k largest/smallest elements in an array.
○ Merge k sorted linked lists.
○ Median of a stream of integers.
6. Hashing:
○ Implement hash map/hash set.
○ Find pairs with a given sum in an array.
○ Find the longest substring without repeating characters.
○ Group anagrams together.
○ Count the frequency of elements in an array.

Algorithms:
1. Sorting and Searching:
○ Implement sorting algorithms (quick sort, merge sort, bubble sort, etc.).
○ Binary search and its applications.
○ Search in a 2D matrix.
○ Find the kth largest/smallest element.
2. Dynamic Programming:
○ Longest Increasing Subsequence (LIS).
○ Longest Common Subsequence (LCS).
○ 0/1 Knapsack Problem.
○ Coin Change Problem.
○ Minimum Edit Distance.
○ Maximum Product Subarray.
3. Greedy Algorithms:
○ Activity Selection Problem.
○ Fractional Knapsack Problem.
○ Job Sequencing Problem.
○ Huffman Coding.
4. Backtracking:
○ N-Queens Problem.
○ Rat in a Maze Problem.
○ Sudoku Solver.
○ Subset Sum Problem.
○ Generate all permutations/combinations.
5. Bit Manipulation:
○ Count the number of set bits in an integer.
○ Check if a number is a power of two.
○ Find the single non-repeating element in an array of duplicates.
○ Swap two numbers without using a temporary variable.

Additional Topics:
1. Mathematical Algorithms:
○ Prime number algorithms (Sieve of Eratosthenes).
○ GCD and LCM.
○ Fibonacci numbers.
○ Factorial of a large number.
2. String Algorithms:
○ KMP algorithm for pattern searching.
○ Rabin-Karp algorithm.
○ Longest Palindromic Substring.
○ String matching algorithms.
3. Miscellaneous:
○ Design and implementation of LRU Cache.
○ Implementing algorithms for common system design problems.
○ Understanding and solving problems using recursion.

You might also like