ending of sort: sort complete.
ascending/descending power is important.
maximum total number of swapping is n*(n-1)/2
comparision number is n-1
quick sort
(n+1)/2 then round up use it as a pivot.
in D1 we always round up.
setp1: choose pivot
step2: write down all the items that r greater/less than the pivot, in front of/behind the pivot.
step3: repeat until the sort complete.