-
Notifications
You must be signed in to change notification settings - Fork 44
Time - Ross #14
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
base: master
Are you sure you want to change the base?
Time - Ross #14
Conversation
CheezItMan
left a comment
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.
Ross, all the methods work, but you implemented the Queue with a straight array instead of a circular buffer. I suggest you review circular buffers just so you are clear on how they can be implemented.
| # Time Complexity: ? | ||
| # Space Complexity: ? | ||
| 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.
👍 , but time/space complexity?
| pairs = { | ||
| "{" => "}", | ||
| "(" => ")", | ||
| "[" => "]" | ||
| } |
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.
Love the use of a hash here.
| @max_size = 20 | ||
| end | ||
|
|
||
| def enqueue(element) |
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 works, but you have implemented the Queue with a straight array instead of a circular buffer.
| @@ -1,19 +1,22 @@ | |||
| require_relative 'linked_list.rb' | |||
|
|
|||
| class Stack | |||
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.
👍
Stacks and Queues
Thanks for doing some brain yoga. You are now submitting this assignment!
Comprehension Questions
OPTIONAL JobSimulation