Question: Question#5: Consider the pseudo code of binary search algorithm as follows: low=0; high=n-1; while (lowvalue high=mid-1; Now solve questions given below: a) Consider an array
Question#5: Consider the pseudo code of binary search algorithm as follows: low=0; high=n-1; while (lowvalue high=mid-1; Now solve questions given below: a) Consider an array [18,22,20,25,30,44,60,51, 37] and value=60. Dry run the code and show in which time complexity class does the algorithm fall. b) Update and show the values of low, mid and high through the iterations. c) What is the T(N) of above algorithm asymptotically? Use a notation of your choice
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
