Lab 04 - Queue
Lab 04 - Queue
Lab 04 – Queue
Exercises/Tasks:
1. Create a Queue using Array. Implement all the required methods (enqueue, dequeue,
getFront, getSize, isEmpty, isFull, and printAll (print from front-to-rear order)). Besides,
show the functionality of the Queue by calling its diGerent methods in the main
method.
Note: Make the queue circular so that insertion should occur if a place is free anywhere
in the array.
2. Create a Queue using Linked List. Implement all the required methods (enqueue,
dequeue, getFront, getSize, isEmpty, and printAll (print from front-to-rear order)).
Besides, show the functionality of the Queue by calling its diGerent methods in the main
method.
3. Create a queue using two stacks. Implement all the required methods of Queue and
show their working in the main method.
4. Write a program to sort a Queue.
5. Any 3 task from leetcode related to Queue.