Hi @gto11520,
Let image that you have a fixed array for 5 items. [][][][][][]
You put 1 front(value 1) & 1 rear (value2) with your code then you will have:
public void insertFront(Item item)...
Type: Posts; User: zkidkid
Hi @gto11520,
Let image that you have a fixed array for 5 items. [][][][][][]
You put 1 front(value 1) & 1 rear (value2) with your code then you will have:
public void insertFront(Item item)...
NullPointer at this code: queArray[i].toString()
your queArray[i] == null.
Please put your whole code.
It's easier than you think.
Please put your code so that we could help.
at the first step, you could only implement queue(E) and dequeue() method to get understand clearly first and then implement others.
it would be easier &...
Yes if you "flow control" mean to make sure "front" always lower than "rear" ( front <= rear)
For better implement, I also suggest you take a look of LinkedList.
At the first time:
When we insert front, your front = max_size -1
Then we insert rear, your rear = 0
Then look at your toString():
for(i = front; i <= rear)
-> front > rear -> print nothing.
...