Created
January 9, 2018 00:48
-
-
Save nerohoop/895bd2eef32bb8385763d07a6c78734e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Build a max heap from the input data. | |
2. Replace the root with the last item of the heap followed by reducing the size by 1. | |
3. Heapify the root of tree. | |
4. Repeat above steps while size of heap is greater than 1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment