题型:单选题 题类:常考题 难易度:普通
浙江省高中信息技术 其他排序算法练习
a(1)=6:a(2)=8:a(3)=7:a(4)=3:a(5)=1:a(6)=2:a(7)=5:a(8)=4
i = 1: j = 8
key = a(1)
Do While i < j
Do While i < j And a(j) >= key
j = j - 1
Loop
a(i) = a(j)
Do While i < j And a(i) <= key
i = i + 1
Loop
a(j) = a(i)
Loop
a(i) = key
For i = 1 To 8
Label1.Caption=Label1.Caption++Str(a(i))
Next i
执行该程序段,标签Label1上显示的内容是( )
a(1) | a(2) | a(3) | a(4) | a(5) | a(6) |
69 | 58 | 32 | 21 | 39 | 33 |
若采用冒泡排序算法对这组数据进行升序排列,那么在完成第一遍排序时,数组元素a(1)到a(6)的数据依次是( )
试题篮