Last active
September 4, 2019 22:12
-
-
Save nikasulo/ca690c182160d603398bef32aefef874 to your computer and use it in GitHub Desktop.
popFront method for Ruby 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 popFront | |
if @last == @first | |
@first = Node.new(nil) | |
@last = @first | |
return | |
end | |
@first = @first.next_node | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment