Design and Analysis of Algorithms MCQs with Answers
Practice important Design and Analysis of Algorithms MCQs with answers and explanations.
Multiple Choice Questions
Q71: The sorting algorithm used to ensure elements are arranged in increasing order is?
- A: Binary Search
- B: Selection Sort
- C: Heapsort
- D: BFS
View Answer
C
Q72: Which algorithm does not use pointers while storing nodes?
- A: Merge Sort
- B: Heapsort
- C: Quick Sort
- D: Insertion Sort
View Answer
B
Q73: What does the 'left(i)' function return in a binary heap?
- A: Index of the right child
- B: Index of the left child
- C: Index of the parent
- D: Index of the root
View Answer
B
Q74: In Heapsort, what is the main purpose of the ‘heapify’ process?
- A: To ensure binary order
- B: To restore the heap property
- C: To delete root node
- D: To increase node height
View Answer
B
Q75: What is the expected height of a complete binary heap with n nodes?
- A: Θ(log n)
- B: Θ(n)
- C: Θ(n^2)
- D: Θ(1)
View Answer
A
Q76: Which of the following is NOT a characteristic of Heapsort?
- A: Utilizes a heap data structure
- B: Worst case is Θ(n^2)
- C: Can be done in-place
- D: Requires heapify
View Answer
B
Q77: The Heapify function restores heap order starting from which node?
- A: Left child
- B: Root node
- C: Right child
- D: Last leaf
View Answer
B
Q78: What is the main strategy behind Quicksort?
- A: Divide and conquer
- B: Merge and sort
- C: Divide and merge
- D: Insert and delete
View Answer
A
Q79: Which algorithm is primarily based on the partitioning of data around a pivot?
- A: Mergesort
- B: Quicksort
- C: Heapsort
- D: Bubblesort
View Answer
B
Q80: In Quicksort, the array is divided based on the value of a ______.
- A: midpoint
- B: pivot
- C: median
- D: last element
View Answer
B