Finds Maximum and Minmum of a unsorted Array