This lab is asking for two ways to sort things, sortStrategyA and sortStrategyB.
SortStrategyA
starting from the end of the list:
for each element in the list going backwards
find the maximum element in the sublist beginning with the first element and ending with the current element
exchange the maximum element with the current element
NOTE: When finding the maximum, you should only search from your current position, to the beginning of the list. Write and use a separate method that finds the greatest element in a stated section of a list of Circles. The method should take a list and two indices as arguments. It should find the largest element in the section of the list that starts with the first index and ends with the second index.
SortStrategyB
starting from the end of the list:
repeat until there are no swaps in one iteration
for each item in the list going backwards
if the item at (index - 1) is greater than the item at the current index, swap them
end repeat
The sort methods must keep track of how many comparisons and swaps have been made while sorting. Think carefully about where to put the code that tracks these values. In SortStrategyB, be careful not to get the number of swaps in one iteration of the outer loop, which will always be zero in the last pass, confused with the total number of swaps. Note that, in either algorithm, the number of swaps cannot be larger than the number of comparisons. Once the list is sorted, the swap method should create a SortResult using the sorted list and the counts of comparisons and swaps. Note that SortResult has a constructor that conveniently takes these values as arguments.
this is very confusing as they are both sorts asking for swaps but i am not sure as to what the difference is in both of these. I understand sortStrategyB but I am not sure what sortStrategyA is asking of me.