-
Notifications
You must be signed in to change notification settings - Fork 49
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
Leaves - Bri #47
base: master
Are you sure you want to change the base?
Leaves - Bri #47
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.
You got problem 1 and the stack, but you didn't use a circular buffer for the Queue. It works, but it wasn't the assignment... so there's that. Not bad, but try to do the work as assigned.
end | ||
|
||
if char == '{' | ||
stack.push '}' |
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.
Close brace?
# Time Complexity: O(n) | ||
# Space Complexity: O(n) | ||
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.
You have the right idea here with one typo. See below.
Do consider using a hash, it could make the code more compact.
@@ -1,16 +1,17 @@ | |||
require 'linked_list.rb' | |||
|
|||
class Queue |
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.
With the Queue you were supposed to use a circular buffer. So this works, but it's not the assignment.
Stacks and Queues
Thanks for doing some brain yoga. You are now submitting this assignment!
Comprehension Questions