Why is it a bad idea to use arrays as a data structure in a limited queue?

I was thinking about implementing limited queues (fixed capacity) using arrays. Then I came across this wiki article on limited queues. He mentioned:

The array is inefficient due to the time spent copying items to the front of the queue

I do not quite understand how this is? When we queue or deactivate, we simply update the indexes to the head or tail. Where do we copy items to the queue?

+3
source share
1 answer

- . , - , , , , . ++. enqueue() if(tail<head+QMAX) , QMAX.

+6

All Articles