Design and Analysis of Algorithms MCQs with Answers
Practice important Design and Analysis of Algorithms MCQs with answers and explanations.
Multiple Choice Questions
Q111: In Counting Sort, the process of filling the output array B from the input array A is done in ____.
- A: Ascending order
- B: Descending order
- C: Random order
- D: Backward order
View Answer
D
Q112: Which variable in Counting Sort determines the final placement of elements in the output array?
- A: k
- B: A[j]
- C: B[i]
- D: C[x]
View Answer
D
Q113: What is the first step in the Counting Sort algorithm?
- A: Initialize C
- B: Calculate A
- C: Initialize B
- D: Copy elements to B
View Answer
A
Q114: Fill in the blank: Counting Sort is particularly effective when _____.
- A: Elements are even
- B: Range of values is small
- C: Range is very large
- D: Values are floating-point numbers
View Answer
B
Q115: Which operation is repeatedly applied to update array C in Counting Sort?
- A: Addition
- B: Comparison
- C: Subtraction
- D: Multiplication
View Answer
A
Q116: What is the main purpose of a bucket sort algorithm?
- A: Sorting elements in ascending order
- B: Storing elements
- C: Counting elements
- D: Filtering elements
View Answer
A
Q117: Bucket Sort is efficient when keys lie within a _______.
- A: large fixed range
- B: small fixed range
- C: variable range
- D: indefinite range
View Answer
B
Q118: In bucket sort, the collection is sorted after which step?
- A: Placing items in bins
- B: Sorting items within bins
- C: Examining each bin
- D: Removing items from bins
View Answer
C
Q119: The time complexity of Bucket Sort is O(______) under optimal conditions.
- A: n + m
- B: n
- C: m
- D: n*m
View Answer
A
Q120: If the number of bins (m) is much greater than the number of items (n), the Bucket Sort time complexity becomes O(______).
- A: m
- B: n
- C: n^2
- D: log(n)
View Answer
A