This is for java just get as close to the UML as you think. UML DIAGRAM FOR AND
ID: 3938056 • Letter: T
Question
This is for java just get as close to the UML as you think.
UML DIAGRAM FOR AND DISCUSSION FOR Queue
Queue<E extends Comparable<E>>
private LinkedList<E> list
<<constructor>> Queue()
<<constructor>> Queue(name : String)
+ enqueue(item : E)
+ dequeue() : E
+ lengthIs() : int
+ peek() : E
+ toString() : String
+ isEmpty() : Boolean
+ clear()
Notes on Queue
The composition technique of Queue is being used. That is, Queue HAS-A LinkedList, as opposed to the inheritance technique where Queue IS-A LinkedList
The implementation of the methods is as discussed and demonstrated in class.
Queue<E extends Comparable<E>>
private LinkedList<E> list
<<constructor>> Queue()
<<constructor>> Queue(name : String)
+ enqueue(item : E)
+ dequeue() : E
+ lengthIs() : int
+ peek() : E
+ toString() : String
+ isEmpty() : Boolean
+ clear()
Explanation / Answer
Please find the required program along with its output. Please see the comments against each line to understand the step.
---------------------------------------------------
OUTPUT:
[5, 7, 1, 9]
[7, 1, 9]
Length: 3
After clear : isEmpty: true
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.