How to sort an Array ArrayList?

Hey!

Tested and working:

import java.util.Collections; //import Collections

ArrayList<ArrayList<Float>> segs = new ArrayList<ArrayList<Float>>();//your array

//Fill your array with random float values
for(int i=0; i<100; i++){
  segs.add(new ArrayList<Float>());
  
  for(int j=0; j<100; j++)
    segs.get(i).add(random(0,10));
}

printArray(segs.get(0)); //display the first row of seg

Collections.sort(segs.get(0)); //sort it by using Collections

printArray(segs.get(0)); //display the first row of seg sorted

You can achieve what you want by using the Collections class (you just give it your ArrayList and he do the job)