Tuesday, 23 October 2012

Maximum and Minimum of array

Find the maximum and minimum of an array of 'n' numbers using only 3n/2 comparisons.

PS: This question was given to us in the DS class.