Recursive Peak Finding in Logarithmic Time

Algorithmically finds the peak value in a given array in logarithmic time using a divide and conquer concept. Reads an input text file representing array values and outputs the indice of the peak value. Click to view file

Input

[0, 2, 6, 18, 17, 16, 15, 13, 11, 9, 3, 1]

Output

Peak value: 18 at index 3