Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves. Alan Kay

Queue implementation

Language Java | Level Intermediate | Category Data structure | August 30, 2015 3:43 pm

Data structure Description

The queue is an abstract data type, in which the element is inserted into the tail, and delete from the head. It stores the items using First in first out principle (FIFO). The queue can be implemented using an array or linked list. The enqueues insert an item to the tail. The dequeue removes the item from the head.

When the queue is empty, the dequeue throws empty queue exception. When the queue is full, the enqueue throws queue full exception.

Write a program to implement the Queue?



Queue size:3
Element 23 is pushed to Queue !
Element 2 is pushed to Queue !
Element 73 is pushed to Queue !
Overflow !
Elements in Queue : 
Pop operation done !
Pop operation done !
Pop operation done !
Underflow !



No comments available!

Please login to add comments.