I have a few more insights.
Firstly, why are you doing the following loop?
Code:
int i = 0;
while (item.size() > myArray[i].size()) {
i ++;
}
Also, you can't set myArray[i] = 0, since they're not pointers but actual objects.
Are you trying to have a fifo or lifo list?
My guess is fifo, in which case, you could just do it as a linked list. If you really want to go the array route, you can keep 2 integers, or an integer and a pointer.
have one be the tracking of where the insertion is going on. Have another track where the deletion is going on.
Optimize from there.