DAA - Question Bank
DAA - Question Bank
Discord
DAA Questions Bank
2-Marks Questions
5-Marks Questions
10-Marks Questions
1. Compare and contrast AVL trees and Red-Black trees. Explain how they maintain balance and
perform insertion and deletion operations.
2. Discuss the properties and applications of B-trees. Explain how B-trees maintain balance and
handle large datasets efficiently.
3. Derive the best and worst-case time complexities of 2-way Merge Sort using the divide-and-
conquer technique.
4. Explain the following sorting algorithms: Counting Sort, Bucket Sort, and Radix Sort. Discuss
the time complexity, advantages, and disadvantages of each. Also, provide an example to
illustrate how each algorithm works.
5. Apply Quick Sort on the following list and sort it in ascending order:
38, 81, 22, 48, 36, 99, 31, 44, 55, 67, 97, 72.
6. Write a detailed explanation of the Knapsack problem and solve a given instance using
dynamic programming.
7. What is the principle behind the greedy algorithm? Discuss its application in solving problems
like activity selection or Huffman coding.
8. Explain the Branch and Bound technique using the 0-1 Knapsack problem.
9. Describe the steps involved in solving the Traveling Salesperson Problem (TSP) using dynamic
programming.
10. Explain the Longest Common Subsequence (LCS) problem with its real-world applications.
Discuss the dynamic programming approach to solving the LCS problem. Including a detailed
explanation of the algorithm, the time complexity, and an example
11. Explain Dijkstra's algorithm in detail. Describe its working, advantages, limitations, and
provide an example with a graph to illustrate how the algorithm finds the shortest path from a
source node.
12. Explain the Floyd-Warshall algorithm with an example. Describe how it works to find the
shortest paths between all pairs of vertices and discuss its advantages and limitations.
13. Explain the process of topological sorting in a directed acyclic graph (DAG). Discuss its
applications and algorithms for performing topological sort.
14. Explain the Bellman-Ford algorithm for finding the shortest path in a graph with negative edge
weights. Compare it with Dijkstra’s algorithm.
15. Describe the Knuth-Morris-Pratt (KMP) algorithm for pattern matching. Explain the
preprocessing phase and the matching phase with an example.
16. Write an algorithm to find the Convex Hull of a set of points using the Gift Wrapping or
Graham’s scan algorithm. Analyze its time complexity.
17. Given two arrays num[] and rem[] where each pair is co-prime (gcd for every pair is 1), find the
minimum positive number x for the following inputs using the Chinese Remainder Theorem:
num[] = {5, 71}, rem[] = {2, 3}
num[] = {3, 4, 5}, rem[] = {2, 3, 1}