Function to sort the segments by their size. It returns a assumeSorted of the segments.
See Implementation
Function to sort the segments by their size. It returns a assumeSorted of the segments.