Skip to content

Latest commit

 

History

History
49 lines (28 loc) · 873 Bytes

File metadata and controls

49 lines (28 loc) · 873 Bytes

English Version

题目描述

给定一个整数数据流和一个窗口大小,根据该滑动窗口的大小,计算其所有整数的移动平均值。

示例:

MovingAverage m = new MovingAverage(3);
m.next(1) = 1
m.next(10) = (1 + 10) / 2
m.next(3) = (1 + 10 + 3) / 3
m.next(5) = (10 + 3 + 5) / 3

 

解法

Python3

Java

...