How do I implement a circular list that overwrites the oldest entry when it\'s full?
For a little background, I want to use a circular list within GWT; so using a 3
If you want a fixed length circular list. You can use a (dynamic) array. Use two variables for houskeeping. One for the position of the next element, one to count the number of elements.
Put: put element on free place. move the position (modulo length). Add 1 to the count unless count equals the lengtht of the list. Get: only if count>0. move the position to the left (modulo length). Decrement the count.