Heapsort Multiple choice Questions and Answers (MCQs)

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

Heapsort Multiple choice Questions and Answers (MCQs)

Question 1
On which algorithm is heap sort based on?
A
Fibonacci heap
B
Binary tree
C
Priority queue
D
FIFO
Bank exam Questions answers
Question 1 Explanation: 
Heap sort is based on the algorithm of priority queue and it gives the best sorting time.

Question 2
In what time can a binary heap be built?
A
O(N)
B
O(N log N)
C
O(log N)
D
O(N2)
English grammar Questions answers
Question 2 Explanation: 
The basic strategy is to build a binary heap of N elements which takes O(N) time.

Question 3
Heap sort is faster than Shell sort.
A
true
B
false
Data interpretation (DI) Questions answers
Question 3 Explanation: 
Heap sort is slower than Shell sort because Shell sort uses Sedgewick's increment sequence.

Question 4
Consider the following heap after buildheap phase. What will be its corresponding array?
A
26, 53, 41, 97, 58, 59, 31
B
26, 31, 41, 53, 58, 59, 97
C
26, 41, 53, 97, 31, 58, 59
D
97, 53, 59, 26, 41, 58, 31
English literature Questions answers
Question 4 Explanation: 
Constructing a max heap using the elements 97, 53, 59, 26, 41, 58, 31 will cause the heap to look like that.

Question 5
In what position does the array for heap sort contains data?
A
0
B
1
C
-1
D
anywhere in the array
Puzzles Questions answers
Question 5 Explanation: 
The array for heap sort contains data at position 0 whereas for a binary heap, array begins at 1. This is the reason for its complexity.

There are 5 questions to complete.

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<