Skip to content

Water - Sophia#37

Open
SoCodeDo wants to merge 1 commit intoAda-C14:masterfrom
SoCodeDo:master
Open

Water - Sophia#37
SoCodeDo wants to merge 1 commit intoAda-C14:masterfrom
SoCodeDo:master

Conversation

@SoCodeDo
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 Stacks are an abstract data structure that stores data with a last-in-first-out order.
What are the 5 methods in Stack and what does each do? 1) push -- adds an item to the stack 2) pop -- removes and returns that last added item 3) is_empty? -- checks if stack is empty 4) peek -- returns but does not remove top item 5) string -- returns string representation of stack
Describe a Queue Queues are an abstract data structure that stores data with a first-in-first-out order.
What are the 5 methods in Queue and what does each do? 1) enqueue -- adds item to queue 2) dequeue -- removes item from queue 3) head -- returns head of queue 4) size -- returns size of the queue 5) empty? -- checks if queue is empty
What is the difference between implementing something and using something? Implementing involves writing the behavior and capabilities; using is simply using what is already there.

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