0% found this document useful (0 votes)
43 views6 pages

Unit 2 QB

This document is a question bank for the Design and Analysis of Algorithms course at SRM Institute of Science and Technology for the academic year 2024-2025. It includes multiple-choice questions covering key concepts such as Divide and Conquer, time complexities of various algorithms, and specific algorithms like Merge Sort and Quick Sort. Additionally, it contains practical problems and theoretical questions related to algorithm analysis and applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views6 pages

Unit 2 QB

This document is a question bank for the Design and Analysis of Algorithms course at SRM Institute of Science and Technology for the academic year 2024-2025. It includes multiple-choice questions covering key concepts such as Divide and Conquer, time complexities of various algorithms, and specific algorithms like Merge Sort and Quick Sort. Additionally, it contains practical problems and theoretical questions related to algorithm analysis and applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

RAMAPURAM, CHENNAI – 89

FACULTY OF ENGINEERING AND TECHNOLOGY

SCHOOL OF COMPUTER SCIENCE AND ENGINEERING

DEPARTMENT OF INFORMATION TECHNOLOGY

21CSC204J DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK- UNIT 2

PART A

ACADEMIC YEAR 2024-2025(EVEN SEMESTER)


1. Which of the following is the basic idea of the Divide and Conquer approach?
o a) Divide the problem into subproblems, solve them recursively, and combine
results ✅
o b) Solve the problem iteratively
o c) Use a greedy approach to find the solution
o d) Solve the problem dynamically
2. What is the time complexity of the Divide and Conquer approach in the worst case?
o a) O(n)
o b) O(n log n) ✅
o c) O(n²)
o d) Depends on the recurrence relation
3. Which of the following problems cannot be solved using the Divide and Conquer
approach?
o a) Binary Search
o b) Fibonacci Series
o c) Tower of Hanoi
o d) Dijkstra’s Shortest Path ✅
4. In Divide and Conquer, the merging step in Merge Sort takes:
o a) O(n) ✅
o b) O(log n)
o c) O(n log n)
o d) O(1)
5. Which of the following sorting algorithms follows the Divide and Conquer approach?
o a) Bubble Sort
o b) Insertion Sort
o c) Merge Sort ✅
o d) Counting Sort
6. The recurrence relation T(n) = 2T(n/2) + O(n) corresponds to:
o a) O(n log n) ✅
o b) O(n²)
o c) O(n)
o d) O(log n)
7. What is the solution for the recurrence T(n) = 8T(n/2) + O(n²) using Master Theorem?
o a) O(n²)
o b) O(n³) ✅
o c) O(n log n)
o d) O(n² log n)
8. The recurrence relation T(n) = T(n/2) + O(1) solves to:
o a) O(log n) ✅
o b) O(n log n)
o c) O(n)
o d) O(n²)
9. If T(n) = 3T(n/2) + O(n), what is the time complexity?
 a) O(n)
 b) O(n^(log₂ 3)) ✅
 c) O(n log n)
 d) O(n²)
10. Which of the following recurrence relations cannot be solved using the Master Theorem?
 a) T(n) = 2T(n/2) + O(n)
 b) T(n) = 3T(n/2) + O(n log n)
 c) T(n) = 2T(√n) + O(n) ✅
 d) T(n) = 4T(n/2) + O(n²)

11. Merge Sort has a worst-case time complexity of:


 a) O(n²)
 b) O(n)
 c) O(n log n) ✅
 d) O(log n)
12. The space complexity of Merge Sort is:
 a) O(1)
 b) O(log n)
 c) O(n) ✅
 d) O(n²)
13. Merge Sort is preferred over Quick Sort when:
 a) The data is large and requires stable sorting ✅
 b) The data is already sorted
 c) There is a small dataset
 d) We need in-place sorting
14. Merge Sort divides the array into:
 a) Three parts
 b) Unequal parts
 c) Two equal parts ✅
 d) Four parts
15. Merge Sort is an example of:
 a) Divide and Conquer ✅
 b) Greedy algorithm
 c) Dynamic programming
 d) Backtracking
16. The worst-case time complexity of Quick Sort is:
 a) O(n²) ✅
 b) O(n log n)
 c) O(n)
 d) O(log n)
17. What is the best-case time complexity of Quick Sort?
 a) O(n²)
 b) O(n log n) ✅
 c) O(n)
 d) O(log n)
18. The partitioning step in Quick Sort runs in:
 a) O(log n)
 b) O(n²)
 c) O(n) ✅
 d) O(n log n)
19. Quick Sort performs better than Merge Sort when:
 a) Data is large
 b) Pivot selection is optimal ✅
 c) Data is already sorted
 d) Data contains duplicates
20. Quick Sort is:
 a) In-place and unstable ✅
 b) In-place and stable
 c) Not in-place and stable
 d) Not in-place and unstable
21. What is the main factor affecting the performance of Quick Sort?
 a) The number of recursive calls
 b) The choice of pivot ✅
 c) The size of the array
 d) The sorting order
22. Strassen’s Algorithm reduces the number of multiplications by:
 a) Reducing the recursion depth
 b) Using iterative methods
 c) Rewriting matrix multiplications with 7 products instead of 8 ✅
 d) Increasing the number of additions
23. What is the best time complexity to find both maximum and minimum in an array?
 a) O(n) ✅
 b) O(n log n)
 c) O(log n)
 d) O(n²)
24. What is the worst-case time complexity of Binary Search?
 a) O(log n) ✅
 b) O(n)
 c) O(n²)
 d) O(n log n)
25. Binary Search can be applied only to:
 a) Sorted arrays ✅
 b) Unsorted arrays
 c) Hash tables
 d) Linked lists
26. What is the time complexity of Strassen’s algorithm?
 a) O(n^2.81) ✅
 b) O(n²)
 c) O(n³)
 d) O(log n)
27. Strassen’s Algorithm reduces the number of:
 a) Multiplications ✅
 b) Additions
 c) Subtractions
 d) Transpositions
28. Strassen’s Algorithm is mainly used for:
 a) Speeding up large matrix multiplications ✅
 b) Sorting algorithms
 c) Graph algorithms
 d) Searching in arrays
29. What is the primary advantage of the Divide and Conquer approach?
o a) It simplifies complex problems by breaking them into smaller
subproblems ✅
o b) It always provides an optimal solution
o c) It works only for numerical problems
o d) It requires less memory
30. Which of the following is a benefit of Divide and Conquer in sorting algorithms?
o a) It reduces the time complexity to O(n log n) in many cases ✅
o b) It requires no extra space
o c) It avoids recursion
o d) It is faster than O(n) algorithms
31. How does Divide and Conquer improve efficiency?
o a) By solving smaller subproblems independently and combining their
solutions ✅
o b) By solving problems in a linear manner
o c) By using an iterative approach
o d) By increasing the number of operations
32. Which of the following Divide and Conquer algorithms is useful for parallel computing?
o a) Merge Sort ✅
o b) Bubble Sort
o c) Selection Sort
o d) Insertion Sort
33. Divide and Conquer is particularly useful for:
o a) Problems that can be broken into smaller independent subproblems ✅
o b) Problems that require brute force methods
o c) Problems where all elements must be processed sequentially
o d) Problems that require a single loop iteration
34. In which of the following scenarios does Divide and Conquer provide a major advantage?
o a) When solving problems that require recursion and parallelism ✅
o b) When dealing with problems that cannot be divided into smaller parts
o c) When all elements must be accessed linearly
o d) When solving problems in constant time O(1)
35. What is an advantage of Divide and Conquer in searching algorithms like Binary Search?
o a) It reduces the time complexity to O(log n) ✅
o b) It works well for unsorted data
o c) It eliminates the need for comparisons
o d) It works faster than O(1) algorithms
36. Why is Divide and Conquer preferred in matrix multiplication (Strassen’s Algorithm)?
o a) It reduces the number of multiplications, making it faster than the
traditional approach ✅
o b) It increases the number of operations to improve accuracy
o c) It requires no extra memory
o d) It is easier to implement than brute force
37. Which of the following is not an advantage of Divide and Conquer?
o a) It always guarantees the most efficient solution ✅
o b) It enables parallel computing
o c) It simplifies complex problems
o d) It helps in designing efficient recursive algorithms
38. The main reason Divide and Conquer is useful in parallel computing is:
 a) Subproblems can be solved independently ✅
 b) It requires a single processor
 c) It avoids recursion
 d) It processes data sequentially
39. Which of the following is true for Divide and Conquer algorithms?
 a) They break problems into smaller subproblems and solve recursively ✅
 b) They always use iteration instead of recursion
 c) They never require additional space
 d) They work only for numerical problems
40. Why is Merge Sort considered a stable sorting algorithm?
 a) It maintains the relative order of equal elements ✅
 b) It sorts in O(n) time complexity
 c) It does not use recursion
 d) It requires no extra space

PART B
1. Solve the following recurrence relations using the Master Theorem and justify your
answers:
 (a) T(n) = 2T(n/2) + O(n)
 (b) T(n) = 4T(n/2) + O(n²)
 (c) T(n) = 3T(n/2) + O(n log n)

2. Sort “MERGESORT” using merge sort and derive its time analysis using Master’s theorem.

3. Sort “YEAR” using quick sort and derive its time analysis using Master’s theorem.
4. In the Array: [2, 5, 8, 12, 16, 23, 38, 45, 56, 72] find “50” using Binary search. Also give its
time analysis.
5. Perform Strassens matrix multiplication for two 3X3 matrix.
6. Find the maximum sum of a contiguous subarray for a given array that contains both positive
and negative integers arr = {-2, -3, 4, -1, -2, 1, 5, -3}

7. Explain the Divide and Conquer approach for solving computational geometry problems such as
Convex Hull and Closest Pair of Points. Discuss the advantages and time complexity of this approach

8. Find maximum and minimum in an array [7,2,9,1,5,3,8,6] using divide and conquer

You might also like