MAD101_-_Test2_-_SU_2024_2075.webp
minhkhai99

MAD101_-_Test2_-_SU_2024_2075.webp

Question: 8
(Choose 1 answer)
Given the Insertion sort algorithm (See picture)
procedure Insertionsort(a1,a2,...,an: integer)
for i = 2 to n do j: = 1 while a; < a₁j: = j+1 temp: = a₁for k := i down to j+1 ax:= ak-1
If input = 7, 2, 4, 3, 1, 6, 5, after running the outer loop with i = 5, the order of the elements in the list is_
a; := temp
A. 1, 2, 3, 4, 7, 6, 5
B. 2, 3, 4, 7, 1, 6, 5
C. 2, 4, 7, 3, 1, 6, 5
D. 1, 2, 3, 4, 5, 6, 7

Thông tin

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

Share this media

Back
Bên trên Bottom