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

Brenna's Stacks & Queues #47

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

Conversation

bcmdarroch
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
Describe a Stack ADT that follows the rule last in, first out.
What are the 5 methods in Stack and what does each do? Push adds an element to the top of the stack. Pop removes the most recently added element, or the top of the stack. Top returns the top of the stack. Size returns the total number of elements. Empty? checks if the stack has any elements.
Describe a Queue ADT that follows the last in, last out.
What are the 5 methods in Queue and what does each do? Enqueue adds an element to the end of the queue. Dequeue removes the first in the queue. Front returns the element that is first in the queue. Size returns the total number of elements. Empty? checks if the queue has any elements.
What is the difference between implementing something and using something? Implementing is defining something (as in a class, method, etc). Using something is using it to do something with your code.

OPTIONAL JobSimulation

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

end

def dequeue
raise ArgumentError.new("You can't dequeue an empty queue!") if empty?

Choose a reason for hiding this comment

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

:)

@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