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

scissors laurel O #58

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

scissors laurel O #58

wants to merge 4 commits into from

Conversation

lolkinetzky
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" usually implemented in a class for an object to define the kinds of values the object takes in, as well as specify the operations performed on said data, and their outcomes.
Describe a Stack an ADT! it's LIFO -> Last in, first out. We can only access the top element of a stack at a time.
What are the 5 methods in Stack and what does each do? we used push, pop, & empty, to add an element, remove an element from the top, and empty to determine if it was empty or not. There is also usually an empty method similar to the empty? method in our queue class and often a peek method to return the top of the stack and sometimes a search method.
Describe a Queue A queue is usually FIFO -> First in, first out. It’s the data structure that simulates waiting in line.
What are the 5 methods in Queue and what does each do? enqueue, (or put), to add data into the queue, dequeue ( or get), to remove and return an item from the queue, size (or length) to return the amount of data in the queue, empty? to determine if there is any data in the queue, and usually there is a method to determine if the queue is full or not, which was handled originally with an exception class in our put or enqueue method.
What is the difference between implementing something and using something? when you’ve implemented the thing, it’s ready for use. This is the thing, it is ready to hold and manipulate data but it isn’t programmatically changing any data until someone uses the ADT (thing) by passing in data.

tried to do the additional challenge. 
ran into issues doing it on my own and referenced a java implementation on stack overflow at some point, but that implementation had it's own issues and used an array rather than a linked list. Hope this is in the ballpark of what is needed... all of the tests past on my IDE with just getting rid of the "que full" exception raise.
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