MAD101_-_FA_2022_-_RE_130.webp
Văn Nam1

MAD101_-_FA_2022_-_RE_130.webp

Multiple choices 35/50
(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 in the list after the second pass (i = 2).
A. 2, 3, 1, 4, 5, 6, 7
B. 2, 1, 3, 5, 4, 6, 7
C. 2, 3, 4, 1, 5, 6, 7
Next
D. 2, 1, 4, 5, 3, 6, 7
procedure Bubblesort(a1,a2,...,an: integer)
for i = 1 to (n-1) do for j = 1 to (n-i) do if a; > a+1 then swap(aj, aj+1)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
43
44
45 46 47 48
49 50
40 41 47

Thông tin

Category
MAD101
Thêm bởi
Văn Nam1
Ngày thêm
Lượt xem
878
Lượt bình luận
7
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom