– Srishti writes a program to find an element in the array A[5] with the following elements in order: 8 30 40 45 70. She runs the program to find a number X.X is found in the first iteration of binary search. What is the value of X?
A. 40
B. 8
C. 70
D. 30
Answer:A
– Srishti writes a program to find an element in the array A[5] with the following elements in order: 8 30 40 45 70. She runs the program to find a number X.X is found in the first iteration of binary search. What is the value of X?
A. 40 B. 8 C. 70 D. 30
Explanation: In binary search technique, mid point is searched first of all.Then, Left and Right nodes are traversed.