0
Find max in java array without sorting?
4 Antworten
+ 2
Here you go sir
I made it as simple as possible
https://code.sololearn.com/cwtss3H7Yu3O/?ref=app
+ 2
@boris I just wanted it as simple as possible.. Thanx for the note. I didn't put -values in mind
0
@Recon, just a little suggestion:
if max = 0 at the beginning, it will not work correct, if all values are less than 0.
Should be:
int max = Integer.MIN_VALUE;
And for array of long values:
long max = Long.MIN_VALUE;
0
thank you sir