MAD101_-_FA_2024_-_Block_5_-_FE_3236.webp
T

MAD101_-_FA_2024_-_Block_5_-_FE_3236.webp

Kizspy | Question: 18
(Choose 1 answer)
(See picture)
A. 3
B. 4
C. 5
D. 6
E. None of the other choices is correct
FUOVERFL
In the bubble sort algorithm
procedure bubble sort (a1, a2,..., an: integers)
for i:=1 to n -1
for j:=1 to n-i if aj > aj+1 then
swap(aj,aj+1)
if the input is the list
{4, 2, 1,3}
how many swaps are used?

  • Like
Reactions: nmcuong147

Thông tin

Category
MAD101
Thêm bởi
thuykieu81
Ngày thêm
Lượt xem
4,736
Lượt bình luận
8
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom