Dynamic size array based queue
Source Code:
Github: DynamicSizeArrayQueue.java
Output:
Capacity : 4 , Size: 0 Capacity : 8 , Size: 6 Queue after enqueue (1, 2, 3, 66, 77, 88) : [1, 2, 3, 66, 77, 88] Queue after dequeue : 1, Queue: [2, 3, 66, 77, 88] Queue after dequeue : 2, Queue: [3, 66, 77, 88] Capacity : 8 , Size: 4 Queue after dequeue : 3, Queue: [66, 77, 88, 4, 5] Queue after dequeue : 66, Queue: [77, 88, 4, 5] Queue after dequeue : 77, Queue: [88, 4, 5] Queue after dequeue : 88, Queue: [4, 5] Queue after dequeue : 4, Queue: [5] Capacity : 4 , Size: 1