Design and Analysis of Algorithms (CS2000) Midterm Oct 2024 Question Paper

RV University Midterm exam for Design and Analysis of Algorithms (CS2000), held Oct 2024, semester 3, with 8 questions. Also searched as DAA, DAOA, ALGO. Last updated 2026-11-14.

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?A. (6/4)n-4 B.
  3. 3. Let H be a binary max-heap consisting of n elements implemented as an array. What is the worst-case time complexity of an optimal algorithm to find the minimum element in H?A. O(1) B. O(log n) C. O(n) D. O(n log n)
  4. 5. Let P be a quicksort program to sort numbers in ascending order. ^t1 and t2 be the number of comparisons made by P for the inputs [4 3 2 1] [1 2 3 4 5] respectively. Which one of the following holds?A. t1=5 B. t1t2 D. t1=t2
  5. 6. Apply BFS to the given graph with vertices {1, 2, 3, 4, 5, 6, 7}.Starting from vertex '1',i) List all possible orders of vertices visited using the BFS algorithm.ii) Mention the total number of orders possible.
  6. 7. Apply Heapsort to sort the following array in ascending order. Track the number of swaps at each iteration (step) and provide the final sorted array.[91, 99, 19, 21, 24, 86, 64, 32].Note: Explicitly mention the number of swaps performed in each iteration.
  7. 8. 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, indicate the
  8. 9. a. 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.b. A complete binary min-heap is made by including each integer in [1, 1023] exactly once. The depth of a node in the heap is the lengt

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