Created
March 5, 2018 22:23
-
-
Save kalub92/3c8ef1c07f95464bc570f4e15704d53a 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
mutating private func heapifyUp() { | |
var index = items.count - 1 | |
while hasParent(index) && parent(index) > items[index] { | |
swap(indexOne: getParentIndex(index), indexTwo: index) | |
index = getParentIndex(index) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment