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

completed stacks and queues worksheet #39

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

Conversation

Allison-Northrop
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 ADT is an abstract data type such as a queue or a stack
Describe a Stack A stack is a collection of data that has the mentality of first one in first one out. So, for example, if there's a pile of papers, the last paper to be put on the papers will be the first one that can be called up.
What are the 5 methods in Stack and what does each do? push- adds another item to the stack. pop- takes the last data type/item inputted and outputs it. top- tells you what's at the "top" of the stack but doesn't do anything with the information. size - tells you how big the stack is/how many elements are in it. empty? - asks if the stack is empty.
Describe a Queue A Queue is a collection of data that has the first in first out mentality. So, the first data/item inputted into the queue will be the first one that is able to be called.
What are the 5 methods in Queue and what does each do? enqueue- inputs a piece of data in the queue. dequeue - outputs the earliest available piece of data in the queue., front - tells you what data type is at the front of the queue(the one you could pull out) but doesn't alter or do anything with the information. size- returns how many pieces of data are in the queue
What is the difference between implementing something and using something? implementing something is creating something that can be used. Using something is actually using the thing implemented

OPTIONAL JobSimulation

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

@sudocrystal
Copy link

Stacks and Queues

What We're Looking For

Feature Feedback
Implementation of Stack looks complete yes
Implementation of Queue looks complete yes

looks good

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