-
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
Shirley #24
base: master
Are you sure you want to change the base?
Shirley #24
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.
Nicely done. I like how you did the postfix exercise. You also did very well with the Queue and the circular buffer. Nice work!
@@ -1,9 +1,58 @@ | |||
require_relative './stack.rb' | |||
require_relative "./stack.rb" | |||
|
|||
def balanced(string) |
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.
👍
return false unless pop_c && pop_c == char_map[c] | ||
end | ||
end | ||
return stack.empty? | ||
end | ||
|
||
def evaluate_postfix(postfix_expression) |
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.
Well done!
end | ||
|
||
def front | ||
raise NotImplementedError, "Not yet implemented" | ||
return @head == -1 ? nil : store[@head] | ||
end | ||
|
||
def size |
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.
Well done!
end | ||
|
||
def to_s | ||
return @store.to_s | ||
clone_store = @store.clone | ||
clone_store.delete(nil) |
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.
Clever
Stacks and Queues
Thanks for doing some brain yoga. You are now submitting this assignment!
Comprehension Questions
OPTIONAL JobSimulation