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?
- . , - , , , , . ++. enqueue() if(tail<head+QMAX) , QMAX.
if(tail<head+QMAX)