# YOU CAN DOWNLOAD 200+ SUBJECTS PDF BOOK FOR COMPETITIVE EXAMINATIONS

## Heapsort Multiple choice Questions and Answers (MCQs)

Question 1 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

On which algorithm is heap sort based on?

Fibonacci heap | |

Binary tree | |

Priority queue | |

FIFO |

Question 1 Explanation:

Heap sort is based on the algorithm of priority queue and it gives the best sorting time.

Question 2 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

In what time can a binary heap be built?

O(N) | |

O(N log N) | |

O(log N) | |

O(N ^{2}) |

Question 2 Explanation:

The basic strategy is to build a binary heap of N elements which takes O(N) time.

Question 3 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

Heap sort is faster than Shell sort.

true | |

false |

Question 3 Explanation:

Heap sort is slower than Shell sort because Shell sort uses Sedgewick's increment sequence.

Question 4 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

Consider the following heap after buildheap phase. What will be its corresponding array?

26, 53, 41, 97, 58, 59, 31 | |

26, 31, 41, 53, 58, 59, 97 | |

26, 41, 53, 97, 31, 58, 59 | |

97, 53, 59, 26, 41, 58, 31 |

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 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

In what position does the array for heap sort contains data?

0 | |

1 | |

-1 | |

anywhere in the array |

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.