... , .
( , " " ):
class LastElementsStore<T> {
Object[] arr;
int size;
int nextPutIndex;
LastElementsStore(int size ) {
arr = new Object[size];
this.size = size;
}
void put(T elt) {
arr[nextPutIndex] = elt;
nextPutIndex++;
if (nextPutIndex == size) {
nextPutIndex = 0;
}
}
}
, .
, nextPutIndex, , 0 .
, node , LinkedList, , ArrayList.
, .
DB - ,
-
50 000 - , Java
- ,
-
- , - / nextPutIndex