How can the following algorithm be described?
left = 0right = len(sortedLyst) - 1while left <= right: midpoint = (left + right) // 2 if target == sortedLyst[midpoint]: return midpoint elif target < sortedLyst[midpoint]: right = midpoint - 1 else: left = midpoint + 1return -1
A. binary search
B. bubble sort
C. sequential search
D. selection sort
Answer: A
Computer Science & Information Technology
You might also like to view...
While working at the help desk, you receive a call and learn that the IP address and mask of a user's PC are 10.11.12.36/11. Determine the number of network (N), subnet (S), and host (H) bits. Which of the following statements are TRUE?
A) N = 9 B) S = 14 C) H = 21 D) S = 6
Computer Science & Information Technology
The architecture design process does not require the implementation of preliminary versions of user documentation.
Answer the following statement true (T) or false (F)
Computer Science & Information Technology