-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ports - Ngoc #31
base: master
Are you sure you want to change the base?
Ports - Ngoc #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! You hit all the learning goals here. Well done.
if (stack.get_last() == "{" && char == "}") || | ||
(stack.get_last() == "[" && char == "]") || | ||
(stack.get_last() == "(" && char == ")") | ||
stack.pop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done a lot more elegantly with a hash.
@@ -22,10 +46,21 @@ def size | |||
end | |||
|
|||
def empty? | |||
raise NotImplementedError, "Not yet implemented" | |||
if @size == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a size variable like this will work, you could also do a bit of math with front and rear.
Stacks and Queues
Thanks for doing some brain yoga. You are now submitting this assignment!
Comprehension Questions
OPTIONAL JobSimulation