0 of 1 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 1 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
冒泡排序算法的伪代码如下:
输入:数组L,n>=1。输出:按非递减顺序排序的L。
算法 BubbleSort:
FLAG <- n //标记被交换的最后元素位置
while FLAG>1 do
k<-FLAG-1
FLAG<-1
for j=1 to k do
if L(j)>L(j+1) then do
L(j)<->L(j+1)
FLAG<-j
对n个数用以上冒泡排序算法进行排序,最少需要比较多少次?( )。