Skip to content

Instantly share code, notes, and snippets.

@slota
Created April 22, 2016 21:48
Show Gist options
  • Save slota/fc81f70b0073bc36bca69855762dece6 to your computer and use it in GitHub Desktop.
Save slota/fc81f70b0073bc36bca69855762dece6 to your computer and use it in GitHub Desktop.
require 'pry'
class Deque
attr_reader :array
def initialize
@array = []
end
def push(var)
@array << var
end
def pop
@array.pop
end
def shift
@array.shift
end
def unshift(var)
@array << var
@array.reverse!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment