DEV Community

Discussion on: How do you find the largest and smallest number in an unsorted integer array?

Collapse
 
jdforsythe profile image
Jeremy Forsythe

I'm not a python guy, but wouldn't this scan the entire array twice? For a large array that would be wasteful. It's probably better to design a single loop and track the min and max values, right?