MAD101_-_SU_2024_-_3_2279.webp
ngoclan1231

MAD101_-_SU_2024_-_3_2279.webp

Kizspy | Question: 14
(Choose 1 answer)
Given the Binary search algorithm (See picture)
If input = 2, 4, 5, 7, 8, 9, 10, 13 and x = 11, after the third time of dividing into sublists, the sublist to be considered is_
A. 13
B. 10
C. 10, 13
D. 9, 10
procedure Binarysearch(a₁<a₂<... <an, x: integer)
i:=1
j:=n
while (i<j)
m:=[(i+j)/2]
if x> am then i: = m+1
else j:=m
if x = a; then location: = i
else location: = 0

Thông tin

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

Share this media

Back
Bên trên Bottom