-
Notifications
You must be signed in to change notification settings - Fork 44
Time - Quin #23
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 - Quin #23
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.
You didn't implement the Queue with a circular buffer. Instead you used a linked list. Other than that you hit the rest of the learning goals here.
| # 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.
👍
| @@ -1,31 +1,32 @@ | |||
| require './linked_list' | |||
|
|
|||
| 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.
This works, but it's not implemented using a circular buffer, so it's not what was asked for.
| @@ -1,22 +1,23 @@ | |||
| require './linked_list' | |||
|
|
|||
| 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
What are the 5 methods in Stack and what does each do?
initializeinitializes the stack (under the hood a linked list)push(data)adds data to the stack (end of a linked list)pop()removes the most recently added elementempty?checks if the stack is empty (t/f)to_sprints the stackWhat are the 5 methods in Queue and what does each do?
initializeinitializes the stack (under the hood a linked list)enqueueadds data to the queue (end of a linked list)dequeueremoves data from the queue (front of a linked list)frontget the data that is first in the queuesizesize of the queueempty?checks if the queue is empty (t/f)to_sprints the queueOPTIONAL JobSimulation