Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote