sort
Sorts the array in ascending natural order.
Parameters
array
array to sort
Sorts the array using the given comparator.
Counting sort is not directly applicable to generic types since it relies on integer indices — this overload falls back to a rank-based counting approach.
Parameters
array
array to sort
comparator
comparator to determine order