-
Notifications
You must be signed in to change notification settings - Fork 44
Time - Hannah T #40
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 - Hannah T #40
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.
Nicely done Hannah. The code works well. In the future take a stab at the time/space complexity. It's good practice. Even guessing wrong is ok.
| # Time Complexity: ? | ||
| # Space Complexity: ? | ||
| def balanced(string) | ||
| raise NotImplementedError, "Not implemented yet" |
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.
👍 Time & space complexity?
| # Time Complexity: ? | ||
| # Space Complexity: ? | ||
| 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.
👍 Time & space complexity?
| raise "Buffer is full" | ||
| end | ||
| @store[@tail] = element | ||
| @tail = (@tail + 1) %20 |
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.
Suggestion for less hardcoded lengths.
| @tail = (@tail + 1) %20 | |
| @tail = (@tail + 1) % @store.length |
| end | ||
| result = @store[@head] | ||
| @store[@head] = nil | ||
| @head = (@head +1) %20 |
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.
| @head = (@head +1) %20 | |
| @head = (@head +1) @store.length |
Stacks and Queues
Thanks for doing some brain yoga. You are now submitting this assignment!
Comprehension Questions
OPTIONAL JobSimulation