Last active
September 3, 2019 16:55
-
-
Save nikasulo/6f2ce858339ab355c6fb3d3529ba9a59 to your computer and use it in GitHub Desktop.
popBack 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 popBack | |
@last = @last.prev_node and return unless @first == @last | |
@first = Node.new(nil) | |
@last = @first | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment