...

/

Challenge 4: Implement Derived Class to Calculate Min/Max/Mean

Challenge 4: Implement Derived Class to Calculate Min/Max/Mean

In this exercise, you have to implement a derived class that will calculate the min, max and the mean of the data set given in the dynamic array.

Problem Statement

In this challenge, you are given a class called DynamicArray which implements a dynamic array of integers that can grow in size.

This class has the following functions:

  • void append(int value): Adds a new value at the end of the array.
  • int get(int index): Returns the value at the given index.
  • int length(): Returns the current size of the array.
  • void resize(): Resizes the array when the maximum capacity is reached. The growth factor is two, therefore, it will each time double the capacity
...