Question: *PYTHON* Function find(a,e) with two inputs: an integer array a, sorted in increasing order, and an integer e. This function must return the index into
*PYTHON*
Function find(a,e) with two inputs: an integer array a, sorted in increasing order, and an integer e. This function must return the index into a of the first instance of the element e in the array or -1 if the element is not present. Binary search is fast so I write the following slight modification to binary search.
Is this algorithm correct? (Prove your claim.)
What is its runtime in the worst case? (Prove your claim.)

1 def bsf(a,e): 2 1,h = 0, len(a)-1 while I
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
