CSD201_-_FA_2023_-_RE_1133.webp
S

CSD201_-_FA_2023_-_RE_1133.webp

(24)
(Choose 1 answer)
The following is the main part of bubble sort pseudocode:
do
swapped := false
for i:= 0 to n-2 if a[i] > a[i+1] then
swap(a[i],a[i+1])swapped := true
end if
end for
while swapped
Consider the list of ten integers below:6, 3, 9, 10, 1, 8, 0, 2, 7, 5
What is the list after the FIRST iteration (for i = 0 to n-2) in a bubble sort? (sorting from smallest to largest).
A. 3, 6, 9, 8, 1, 0, 2, 7, 5, 10
B. 3, 6, 9, 0, 1, 8, 2, 7, 5, 10
C. 3, 6, 9, 1, 8, 0, 2, 5, 7, 10
D. 3, 6, 9, 1, 8, 0, 2, 7, 5, 10

Thông tin

Category
CSD201
Thêm bởi
singing_bird
Ngày thêm
Lượt xem
2,942
Lượt bình luận
30
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
CSD201_-_FA_2023_-_RE_1133.webp
File size
69 KB
Dimensions
1926px x 906px

Share this media

Back
Bên trên Bottom