Find the max and min elements of an unsorted integer array using a
minimal number of comparisons