Explain how heap sort works.

What will be an ideal response?


First, a maxheap is created on the elements that need to be sorted. Next, the elements are removed, one-by-
one, from the root. The elements will be removed from the heap in descending order, and therefore they can be sorted. To sort
the list in ascending order, a minheap can be used instead.

Computer Science & Information Technology

You might also like to view...

Numbers displaying to the left of a series of bullets on a slide indicate the animation sequence

Indicate whether the statement is true or false

Computer Science & Information Technology

A form contains all of the following EXCEPT:

A) settings to restrict changes. B) content controls. C) static text. D) digital certificate.

Computer Science & Information Technology

You can resize a chart by clicking and dragging a sizing handle

Indicate whether the statement is true or false

Computer Science & Information Technology

What term refers to recovering fragments of a file?

a. Carving b. Slacking c. Saving d. Rebuilding

Computer Science & Information Technology