Queue
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRtZJODbDeICwy0TcXq9SsUlFuuHcGJZMYrxoBGQu04D1AzQ-TsD8m9lXz_2-k_vA00wlDN-T4yQCDJsx9lJIF0C6NP2FoqjJdXtgIAz33w-KkI5FayMrLq3ydfLK3j_nnFqBE9DDqtPg/s16000/queue+1.jpg)
Queue Demonstration of queue using linked list in JAVA package com.company ; import java.util. Queue ; import java.util.LinkedList ; public class Main { public static void main ( String [] args ) { // write your code here Queue < Integer > q = new LinkedList <> (); q . add ( 10 ); q . add ( 1 ); q . add ( 8 ); q . add ( 4 ); q . add ( 7 ); q . add ( 89 ); System . out . println ( "The queue is: " + q ); } } The queue is: [10, 1, 8, 4, 7, 89] Process finished with exit code 0 Show peak of queue package com.company ; import java.util. Queue ; import java.util.LinkedList ; public class Main { public static void main ( String [] args ) { // write your code here Queue < Integer > q = new LinkedList <> (); q . add ( 6 ); q . add ( 1 ); q . add ( 8 ); q . add ( 4 ); q . add ( 7 ); q . add ( 89 ); System