MAD101_-_FA_2024_-_FE_2995.webp
Ngọc Trinh

MAD101_-_FA_2024_-_FE_2995.webp

(Choose 1 answer)
Given the Binary search algorithm (See picture)
If input 2, 4, 5, 7, 8, 9, 10, 13 and x = 6, after the second time of dividing into sublists, the sublist to be considered is
A. 5,7
B. 7, 8, 9
C. 5, 7, 8
D. 2, 4, 5
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
wi
2: 40

Thông tin

Category
MAD101
Thêm bởi
Ngọc Trinh
Ngày thêm
Lượt xem
4,585
Lượt bình luận
7
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
MAD101_-_FA_2024_-_FE_2995.webp
File size
215.9 KB
Dimensions
1920px x 892px

Share this media

Back
Bên trên Bottom