Heap Sort
1. Which of the following sorting algorithms, in its typical implementation, gives the best performance when applied to an array that is sorted or almost sorted (with at most 1 or 2 elements misplaced)?
2. Consider a full binary min-heap containing elements with distinct keys. What is the probability that the largest element is at the last level?
3. In a max-heap, the element with the greatest key is always in which node?
4. Heap can also be used as _______.
5. An array consists of elements. We want to create a heap using these elements. The time complexity of building a heap will be in the order of ________.
6. Which of the following is the main reason Heap Sort has worst-case time complexity?
7. Which of the following statements about Heap Sort is correct?
8. For ascending-order Heap Sort, why is a max-heap commonly used?
9. If the input array contains elements, what is the worst-case time complexity of Heap Sort?