- Build a Deque Implementation using a Wrapped LinkedList
- Implement some useful deque methods
- Implement an efficient stack merging method using a Deque
- Implement a new data structure using a deque
Given the Deque ADT, implement a Deque using your DoublyLinkedList. Then use the Deque and other ADTs to solve the follwoign problems:
- Suppose you have two nonempty stacks S and T and a deque D. Describe how to use D so that S stores all teh elements of T below all of its origanl elements with both sets of elements still in their original order.
- Using a Deque to design a two-color DoubleStack ADT which repreents two stacks -- one "red" and one "blue" -- and which has two versions of the basic stack operations.
- Fork this repository
- Review the two new interfaces in
edu.isu.cs.structures
package --Deque
andRedBlueDoubleStack
. Pay close attention to the methods defined, any interfaces they extend, and the documentation provided. - Using those interfaces implement:
LinkedDeque
which is aDeque
based on aDoublyLinkedList
as a basis andRedBlueDoubleStackImpl
which is aRedBlueDoubleStack
which is based on aDeque
. - Once you have those implemented, then implement the method
<E> void dequeStackMerge(Stack<E> into, Stack<E> from)
in classDequeStackMerge
. Be sure to take note of the documentation and even peruse the associated tests to fully understand this method.
When you have completed the assignment (all tests pass) or it is reaching midnight of the due date, make sure you have completed the following:
- Committed all changes to your repo
- Pushed your changes to GitHub
- Tagged your repo as "COMPLETE"
- Pushed the "COMPLETE" tag to GitHub
- Submitted your repository URL to Moodle in the Mission 01 submission section.
- DequeStackMerge - 3 Points
- LinkedDeque - 31 Points
- RedBlueDoubleStack - 30 Points
- Comments and Style - 6 Points