Skip to content

Conversation

@jwinchan
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? Abstract Data Types are objects that are defined by their methods and how the methods perform
Describe a Stack A stack is an ADT that stores data in a Last In First Out structure
What are the 5 methods in Stack and what does each do? push: adds new data to the top of the stack, pop: removes data from the top of the stack, is_empty: returns a boolean depending on whether the stack is empty or not, peek: returns the data at the top of the stack without removing, size: returns the number of items stored in the stack
Describe a Queue A stack is an ADT that stores data in a First In First Out structure
What are the 5 methods in Queue and what does each do? enqueue: adds new data to the back of the queue, dequeue: removes data from the front of the queue, is_empty: returns a boolean depending on whether the queue is empty or not, size: returns the number of items stored in the queue, front: returns the data at the front of the queue without removing
What is the difference between implementing something and using something? Implementation is the behind-the-scenes creation of methods, ADTs, classes, etc. On the other hand, using those methods, ADTs, classes doesn't require knowledge of how they are implemented.

OPTIONAL JobSimulation

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

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