MAD101_-_FA_2023_-_RE_1116.webp
T

MAD101_-_FA_2023_-_RE_1116.webp

(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
If input = 3, 2, 4, 7. 1. 6. 5, after running the outer loop with i = 5, the order of the elements in the list is
j:= j+1
A. 1, 2, 3, 4, 7, 5, 6
temp: = a;for k: i down to j+1
B. 1, 2, 3, 4, 6, 7,5
a: ak-1 a := temp
C. 1, 2, 3, 4, 7, 6, 5
D. 1, 2, 3, 7, 4, 6, 5


Exit 43

Thông tin

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

Image metadata

Filename
MAD101_-_FA_2023_-_RE_1116.webp
File size
49.6 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom