Created
February 17, 2015 23:17
-
-
Save mitchfriedman/8efe6d09c077d1e8c619 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
int parent = floor(position/2); | |
if(position != 0) { | |
/* less than 1, swap required */ | |
if( (*queue)->compare( (*queue)->items[parent]->value, (*queue)->items[position]->value ) > 0 ) { | |
swap(queue, parent, position); | |
upHeap(queue, parent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment