Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public static int[] maxIndexes(int[] list)
  2. {
  3. int maximum = list[0];
  4. int index = 0;
  5. int [] tempArray = new int [list.length];
  6. for ( int i = 1; i < list.length; i++ )
  7. {
  8. if ( list[i] >= maximum )
  9. {
  10. index = i;
  11. maximum = list[i];
  12. tempArray[i]=maximum;
  13. list[i]=Integer.MIN_VALUE;
  14. }
  15. }
  16.  
  17. return tempArray;
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement