.寫出下列排序算法的基本思想並寫出對序列()進行排序時每一趟的結果
PROC bbsort(VAR r: sequence; n: integer);
{r是一個數組}
d:=; pos[]:=; pos[]:=n; i:=; exchanged:= true;
WHILE exchanged DO
[ exchanged:= false;
WHILE i<>pos[d] DO
[IF (r[i]r[i+d])*d> THEN [r[i]與r[i+d]交換; exchanged:=true;];
i:=i+d;
]
pos[d]:=pos[d]d; i:=pos[d]; d:=d;
]
ENDP;【山東科技大學 五 (分)】
.設要求從大到小排序問在什麼情況下冒泡排序算法關鍵字交換的次數為最大【南京航空航天大學 九 (分)】
.設與記錄RR…Rn對應的關鍵詞分別是KK…Kn如果存在Ri和Rj使得j<i且Ki<Kj成立試證明經過一趟起泡後一定有記錄與Ri進 行交換 【吉林大學 四 】
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
From:http://tw.wingwit.com/Article/program/sjjg/201311/22977.html