Read online about the median of a sample
Implement the logic of the sort() method. It must sort the data in the array according to its distance from the median. Return the array sorted from the least to greatest distance. If several numbers are equally distant, then sort them in ascending order.
Think and you will succeed
Soldiers have always assembled, do assemble, and will assemble by descending height. After thinking about whether it would be better to use Comparable or Comparator for this task, sort the soldiers.
A convert can easily convert others
A table has columns that can be sorted. The user can customize the list of columns that will be sorted. Write a public static Comparator CustomizedComparator that will: 1. take an array of comparators via the constructor. 2. sort data in the order that corresponds to the sequence of comparators.
GO TO FULL VERSION