Skip to content

Conversation

brittanygcle
Copy link

Stacks and Queues

Thanks for doing some brain yoga. You are now submitting this assignment!

Comprehension Questions

Question Answer
What is an ADT?
Describe a Stack
What are the 5 methods in Stack and what does each do?
Describe a Queue
What are the 5 methods in Queue and what does each do?
What is the difference between implementing something and using something?

OPTIONAL JobSimulation

Question Answer
Did you include a sample run of your code as a comment?

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️
This isn't a circular buffer. It works, but you're not doing it by the prescribed algorithm.

Let me know if you have questions about it.

Comment on lines 27 to -25
def enqueue(self, element):
""" Adds an element to the Queue
Raises a QueueFullException if all elements
In the store are occupied
returns None
"""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This doesn't work as a circular buffer. I suggest using the self.front and self.rear indexes.

Comment on lines 41 to 45
def dequeue(self):
""" Removes and returns an element from the Queue
Raises a QueueEmptyException if
The Queue is empty.
"""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Ditto with this method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants