Skip to content

Conversation

@made-line
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 type, which is a type of object that's described by the methods it has and is independent from its implementation.
Describe a Stack A stack is a data structure that stores/provides access to a list of data in last-in-first-out order.
What are the 5 methods in Stack and what does each do? push: puts an item at the top of the stack. pop: removes and returns the item on the top. is_empty: returns true if the stack is empty. peek: returns the items on the top of the stack. size: returns the number of items on the stack.
Describe a Queue A queue is a data structure that stores/provides access to a list of data in first-in-first-out order.
What are the 5 methods in Queue and what does each do? enqueue: adds an item into the back of the queue. dequeue: removes and returns the item at the front of the queue. is_empty: returns true of the queue is empty. peek: returns the items on the top of the queue. size: returns the number of items on the queue.
What is the difference between implementing something and using something? When implementing something, it can be done in a variety of ways and is independent of its description or how the thing performs. Using something is the opposite; there's a specific way of using it and its implementation details are not hidden.

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.

1 participant