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.
Get Free Quote!
262 Experts Online