It depends on how many operations you will perform and how exactly the version of the array is implemented.
, 1000 /, , . , .
, 30 , , , .
, , .
EDIT:
@Hans Passant, , . , , , , L2. , , . . , , . , , , , , .
, , , , , , , ? , , - 800 . ? , , . , . , , , , . , , ( gcc) NDEBUG -O3.
:
, , , . , , , , , int "" .
:
int ciruclarArray[SIZE];
int front = 0;
int back = 0;
void enqueue(int elem)
{
circularArray[back] = elem;
if(back < (circularArray.length - 1))
back++;
else
back = 0;
return elem;
}
int dequeue()
{
int toReturn = circularArray[front];
return toReturn;
}
.