試卷名稱:113年 - 113 學士後醫學系招生考試試題:計算機概論與程式設計#119574
年份:113年
科目:研究所、轉學考(插大)、學士後-計算機概論
20. You are given a Python function that is supposed to implement the binary search algorithm to find the index of a target element in a sorted list. However, there is a mistake in the code. Identify the mistake and provide the corrected version of the code.
(A) Change len(arr) to len(arr)-1
(B) Change the condition in the while loop to while left<right
(C) Change left=mid+1 to left=mid
(D) Change right=mid-1 to right=mid
(E) Add a condition to handle the case when the target is not found in the list