-
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
Nara #26
base: master
Are you sure you want to change the base?
Nara #26
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.
Overall nice work. There are some issues with the Queue and the circular buffer. Take a look at my notes and let me know what questions you have.
@@ -1,7 +1,25 @@ | |||
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.
👍
end | ||
|
||
def dequeue | ||
raise NotImplementedError, "Not yet implemented" | ||
if @front == @rear |
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 first need to check to see if front and rear are both -1, if so, then the queue is empty, and you should raise an error.
Otherwise if front == rear then the queue is full.
end | ||
|
||
def empty? | ||
raise NotImplementedError, "Not yet implemented" | ||
if @store[@front...@rear].length == 0 |
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.
What if the rear has wrapped around the buffer and is now less than the front?
Stacks and Queues
Thanks for doing some brain yoga. You are now submitting this assignment!
Comprehension Questions
OPTIONAL JobSimulation