-
Notifications
You must be signed in to change notification settings - Fork 63
Lilly C16 Pine #54
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?
Lilly C16 Pine #54
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.
✨🌸 Hi Lilly, take another look at your str
implementation for Stack; I think there were some missteps there. Otherwise, your implementations for Queue and Stacks looked really solid.
Since the comprehension questions were not filled out, I'm grading this as a yellow. Feel free to resubmit with them filled out and your 'str' method updated for a green score.
🟡
In the store are occupied | ||
returns None | ||
""" | ||
pass |
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.
✨
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.
resubmitted, some formatting was off for questions, and missing a couple answers
Raises a QueueEmptyException if | ||
The Queue is empty. | ||
""" | ||
pass |
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 self.front == -1: | ||
return None |
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.
Because you never check in dequeue
whether dequeuing an element makes the Queue empty and, if the Queue does become empty, reset front
to point at index -1, it may not always be true that the front pointer is at index -1 when the queue is empty. Try using the empty
method you implement instead.
if self.front == -1: | |
return None | |
if self.empty(): | |
return None |
The Queue | ||
""" | ||
pass | ||
return self.size |
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.
✨
And False otherwise. | ||
""" | ||
pass | ||
return self.size == 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.
✨
""" Returns the Queue in String form like: | ||
[3, 4, 7] | ||
Starting with the front of the Queue and | ||
ending with the rear of the 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.
✨
Returns None | ||
""" | ||
pass | ||
self.store.add_first(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.
✨
returns None | ||
""" | ||
pass | ||
return self.store.remove_first() |
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.
✨
And False otherwise | ||
""" | ||
pass | ||
return self.store.empty() |
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_queues/stack.py
Outdated
String = "[" + str(self.store.first()) + "]" | ||
return 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.
String
is a keyword (name of the String class) in Python, so you want to avoid using it as your variable name. Additionally, you're only returning the first element of the Stack here - the specification asks for the entire stack to be printed instead. The Stack tests don't cover this method which is why they didn't catch this.
Try taking advantage of the str
method in the LinkedList
class instead.
resubmitted |
Stacks and Queues
Thanks for doing some brain yoga. You are now submitting this assignment!
Comprehension Questions
| What is the difference between implementing something and using something? | Implementing something is create a method yourself versus using something that was already created |
OPTIONAL JobSimulation