Dec 26, 2008

Find max and min numbers out of n numbers

Find max and min numbers out of n numbers
Each time you read two numbers, first compare two numbers and than use smaller number to compare the min, if needed update, use bigger one to compare max if needed update. The time is O(n*3/2)

No comments:

Post a Comment