Last active
December 29, 2015 13:39
-
-
Save seanreed1111/7678739 to your computer and use it in GitHub Desktop.
class SimpleStack
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
class SimpleStack | |
def initialize | |
@stack = Array.new | |
end | |
#removes the first item from the stack and returns the item popped | |
def pop | |
@stack.pop | |
end | |
#pushes item to stack and returns @stack | |
def push(item) | |
@stack.push(item) | |
end | |
def size | |
@stack.length | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment