Design and Analysis of Algorithms (CS2000) Midterm Sep 2025 Question Paper

RV University Midterm exam for Design and Analysis of Algorithms (CS2000), held Sep 2025, semester 3, with 9 questions. Also searched as DAA, DAOA, ALGO. Last updated 2026-11-20.

Questions

  1. 1. Which of the following sorting algorithm's time complexity is the most inefficient in the best-case?A. Merge sort B. Insertion Sort C. Quicksort D. Selection sort
  2. 2. Suppose there are 8 sorted arrays of (n/8) elements each. If we merge these arrays into a single sorted array of n elements using two-way merge (merge two sub-arrays recursively), then how many key comparisons are needed in the worst-case using the merge algorithm? Note: Size of
  3. 3. Which statement is true about stability in sorting algorithms?A. Stability guarantees the fastest execution timeB. A stable sort preserves the relative order of equal elementsC. Stability can only be achieved with O(n2) algorithmsD. All divide-and-conquer sorting algorithms are s
  4. 4. A certain permutation of integer stored in an array is provided as an input to the algorithm of quicksort. After one pass of algorithm the status of the array is 7, 16, 12, 13, 18, 15, 17, 23. Find the sum of all possible values that could have been used as a pivot .
  5. 5. Consider the following array of elements: 45, 32, 60, 25, 18, 22, 75, 15, 10, 12, 8, 5, 90. The minimum number of interchanges (swaps) needed to convert it into a max-heap is .
  6. 6. 6 Item 1 2 3 4 5 6 7 5 L2 CO3 Profit 12 20 15 18 6 22 8 Weight 2 4 6 9 3 5 2 The knapsack has a capacity of 20 kg. Using the greedy fractional knapsack approach, what is the maximum profit achievable?
  7. 7. Apply QuickSort to sort the following array in ascending order. Track the number of swaps at each iteration (step) and provide the final sorted array.[21, 19, 15, 7, 1, 5, 3, 12]Note: Mention clearly which index is being used as a pivot (first or last).Additionally, make sure to
  8. 8. Apply BFS to the given graph with vertices {1, 2, 3, 4, 5, 6, 7}.Starting from vertex 'I',i) List all possible orders of vertices visited using the BFS algorithm.ii) Mention the total number of orders possible.
  9. 9. The number of possible max-heaps containing each value from {1, 2, 3, 4, 5} exactly once is . You are required to draw all possible max-heaps.

More Design and Analysis of Algorithms papers

Browse more RVU papers

RVU 3rd semester previous year question papers · RVU Midterm previous year question papers · RVU School of Computer Science and Engineering (SoCSE) question papers