Skip to content
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

Hanh Solo @ Water-Stacks and Queues #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seattlefurby17
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? An Abstract Data Type, is a type of object which is described by the methods it has and how they perform. Implementation details are not included.
Describe a Stack A Stack is a data structure which stores a list of data and only provides access in a Last-In-First-Out (LIFO) order.
What are the 5 methods in Stack and what does each do? push(item) - This method puts an item into the stack at the top.
pop - This method removes and returns the item on the top of the stack.
is_empty - This method returns true if the stack is empty and false otherwise.
A Stack might also implement a peek method which returns, but does not remove the item on top of the stack, and size which would return the number of items on the stack.
Describe a Queue A queue unlike a stack operates in a first-in-first out order. Like a line of people at a concert, the first element to enter the queue is the first element removed.
What are the 5 methods in Queue and what does each do? enqueue(item) - This method puts an item into the back of the queue.
dequeue - This method removes and returns the item at the front of the queue.
is_empty - This method returns true if the queue is empty and false otherwise.
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?

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