Last active
September 3, 2019 16:52
-
-
Save nikasulo/4f2510ac4fa00850aeb94d7c41996d0b to your computer and use it in GitHub Desktop.
pushFront method for deque
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
def pushFront(number) | |
@first = Node.new(number, @first, nil) | |
@last = @first if @last and @last.value.nil? | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment