I have a list of values that increase to the maximum and then decrease again (this is the observed Gaussian / bell-shaped distribution).
values = [0, 4, 5, 15, 30, 20, 10, 5, 0];
But the distribution can also be biased:
values = [0, 0, 0, 1, 2, 3, 8, 15, 30];
Or similarly:
values = [30, 20, 5, 2, 1, 1, 0, 0, 0];
Determining a value by a specific index is very expensive in this particular application, so it is important to use the smallest possible number of array searches.
Solutions such as hill climbing or the binary search option should work. What is the algorithm with the smallest possible steps?
A long search time is associated with a real measuring device (time in seconds).