Answer:
Step-by-step explanation:
Java Collections sort() Method :
By default, this method sorts the unsorted list into ascending order , according to the natural ordering of the list items. We can use Collections.reverseOrder() method for reverse sorting.
Condition are basically for any sorting algo. First one the Output is in non-decreasing order (Each elements is no smaller than the previous element according to the desired total order). Second is the output is a permutation (a reordering, yet retaining all of the original elements) of the input.