Fixed size array is enough for this problem.

Java:

```
public class MovingAverage {
int[] window;
int index = 0;
/** Initialize your data structure here. */
public MovingAverage(int size) {
this.window = new int[size];
}
public double next(int val) {
this.window[index] = val;
index = (index+1)%this.window.length;
double ans = 0.0;
for (int i:window) {
ans += i;
}
return ans/this.window.length;
}
}
```

Python:

```
class MovingAverage(object):
def __init__(self, size):
"""
Initialize your data structure here.
:type size: int
"""
self.size = size;
self.window = [0]*size;
self.index = 0;
def next(self, val):
"""
:type val: int
:rtype: float
"""
self.window[self.index] = val
self.index = (self.index+1)%self.size
return float(sum(self.window))/self.size
```