
In the context of the queue data structure, the increment and decrement of array size work in the following way: Decrease factor:- It decides when the size of the array should be decreased.Increase Factor:- Multiplication factor by which the array size is increased, for example, increase factor 2 means the size of the array is double every time it gets too full.

Initial capacity:- Size of the array during its creation.For this first create the following three variables, these variables will help us to decide when the size of the array should be increased and when it should be decreased. We have to implement a dynamic array using an array object provided in java language.
ENQUEUE AND DEQUEUE IN JAVA USING ARRAY FULL
Queue.isEmpty() // returns false Solutionĭynamic array is an array whose size automatically increased when it gets too full and, its size gets decreased when it is too empty.

isEmpty() :- It checks whether the queue is empty.peek() :- It returns (not remove) the element from the front of the queue.dequeue() :- It removes and returns the element from the front of the queue.

