With an array of length 200, a new number is added to position [0] every second, pushing the other values up one position in the array.
I am looking for a way to determine the maximum and minimum values of the entire array each time a new number is added. I want to analyze all 200 values before adding a new one.
I have been able to achieve this, but encountered difficulty discarding the 'old' maximum and 'old' minimum values once they are pushed out of the array.
To address this issue, I tried using the first differential and storing the current value in another array. However, this led to multiple occurrences of the maximum or minimum values in no specific order. I aim to have only one maximum and one minimum value stored at a time.