Created
August 24, 2019 22:57
-
-
Save nikasulo/1c8ee8410b6700270eea73e7e460c280 to your computer and use it in GitHub Desktop.
Check for runner ups
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
#check if what's currently in the back is a potential winner | |
if deque.topBack > array[i] | |
#if it is, store the runner up behind it | |
deque.pushBack(array[i]) | |
else | |
#if it's not, remove it and then store the new winner in the back | |
deque.popBack | |
deque.pushBack(array[i]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment