Queue
A queue is a particular kind of abstract data type or collection in which the entities in the collection are kept in order and the principal (or only) operations on the collection are the addition of entities to the rear terminal position, known as enqueue, and removal of entities from the front terminal position, known as dequeue. This makes the queue a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed.
A basic queue has the following operations: put: add a new element to the end of the queue. pop: remove the element from the front of the queue and return it. peek: returns the element at the head of the queue, without removing it.
We want you to implement a queue with the following operations: 1: Enqueue element x into the end of the queue. 2: Dequeue the element at the front of the queue. 3: Print the element at the front of the queue.
Errors are not handled in the above program such as when queue is empty, overflow, underflow etc. If you want to practice Java(beginners) try it. HAPPY CODING !! :)