Q16.webp
Yaga97

Q16.webp

  • Media owner Yaga97
  • Ngày thêm
Question: 16
(Choose 1 answer)
Given the Bubble sort algorithm (See picture)
If input = 3, 2, 4, 7, 1, 6, 5, find the order of the elements after completing the first pass (i = 1).
A. 2, 3, 4, 1, 6, 5, 7
B. 2, 3, 4, 1, 5, 6, 7
C. 2, 3, 1, 4, 6, 5, 7
D. 2, 3, 1, 4, 5, 6, 7
E. None of the other choices is correct
Procedure Bubblesort(a1, a2.....an: integer)
fori 1 to (n-1) do
for j 1 to (n-i) do
if a; > a+1 then
swap(aj, aj+1)

Thông tin

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

Share this media

Back
Bên trên Bottom