A. Write a method named partition that accepts a List of Calendar Dates and a Calendar Date value E as its two parameters, and rearranges (partitions) the list so that all its elements less than E occur before all elements greater than E. The exact order of the elements is unimportant so long as all elements less than E appear before all elements greater than or equal to E. For example, for the list [1/6, 1/2, 3/9, 4/1], one acceptable ordering of the list after the call of partition(list, 1/5) would be [1/2, 3/9, 4/1, 1/6]. B. Write a method named sortAndRemoveDuplicates that accepts a List of CalendarDates as its parameter and rearranges the list's elements into sorted ascending order, as well as removing all duplicate values from the list. For example, the list [1/7, 1/4, 1/4] would become [1/4, 1/7] after a call to your method.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |