.写出下列排序算法的基本思想并写出对序列()进行排序时每一趟的结果
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进 行交换 【吉林大学 四 】
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []