-
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
Branches - Diana Han #26
base: master
Are you sure you want to change the base?
Conversation
Hi Chris! Can I get more time to revise methods where I'm failing the tests, I can get them done by EOD! |
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.
Nice work, you hit all the learning goals here. Very nice work with the circular buffer.
# 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.
👍
# @store = ... | ||
raise NotImplementedError, "Not yet implemented" | ||
@store = Array.new(50) | ||
@front = @back = -1 | ||
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.
👍
end | ||
|
||
def dequeue | ||
raise NotImplementedError, "Not yet implemented" | ||
def dequeue #remove and return from front |
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 size | ||
raise NotImplementedError, "Not yet implemented" | ||
@back - @front |
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 when front < back. What about when back has wrapped around the buffer.
if @front == @back | ||
return true | ||
end |
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.
if @front == @back | |
return true | |
end | |
return @front == @back |
raise NotImplementedError, "Not yet implemented" | ||
if @front == @back | ||
return true | ||
end | ||
end | ||
|
||
def to_s |
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.
👍 Well done
Stacks and Queues
Thanks for doing some brain yoga. You are now submitting this assignment!
Comprehension Questions
OPTIONAL JobSimulation