Is heap sort stable? Explain with an example. If it is not stable, can it be made stable?
What will be an ideal response?
Heap sort is not stable. If there are two elements with the same value, there is a chance that they will both have the same parent node, and depending on the other elements already in the heap, one could become the left child and one the right, or they could be switched. Also, one could instead become a child of the other. It cannot be made stable without changing what is stored in the tree. An extra key could be added to each element, and this would eliminate duplicates.
You might also like to view...
You can eliminate using multiple OR criteria by inserting a _________ in your query
Fill in the blank(s) with correct word
When using an array of data with the FREQUENCY function, the following keystroke is required
A) Ctrl+Alt+Delete B) Ctrl+Shift+Enter C) Ctrl+Shift+Delete D) Ctrl+Enter
Higher ________ cameras can capture more detail, but they will produce a larger image file on your storage media.
A. contrast ratio B. megapixel C. gigahertz D. gigabit
When using the compress utility, each file specified for compression is renamed with what extension?
A. .c B. .cmp C. .cpz D. .Z