Math, asked by ashishaj3627, 1 year ago

How to find the largest and smallest number in an unsorted integer array?

Answers

Answered by bewinda
1

Answer:

let’s assume that you have no information about the integer values in the array. They could be positive or negative, and we know nothing about the range of the numbers.

Then the best thing you can do to find the maximum value in the array is to iterate through it, and keep track of the maximum value found so far. By the time you reach the end of the array, you’ll know the maximum value.

Similar questions