โก๏ธ Front
Returns the first element of the array (the most recent element added).
๐ Syntaxโ
TypeOfArray front()
๐ฎ Exampleโ
// This will create an MovingAverage of size 4 and int type
DataTomeMvAvg<int> intAverage(4);
// Will return 0
intAverage.front();
// Array: 8 0 0 0
intAverage.push(8);
// Will return 8
intAverage.front();
โฑ Complexityโ
Constant (O(1)).