russian peasant's algorithm
russian peasant's algorithm
v=u。i
要看谁依赖于谁,找直接的依赖关系
优先表和活动图要相互转化
Dumy有方向,表示特殊的关系
是不占用时间和金钱的
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.