Question: Activity III ( week 3 ) 1 5 pts Q 1 . Let A ( 1 . . 5 5 ) = 2 2 ,

Activity III (week3)
15pts
Q1. Let A(1..55)=22,23,dots,75,76. How many element comparisons are performed by algorithm BINARY SEARCH when searching for the fallowing values of x?
(a)=63
(b)=80
a=63
\table[[low,high,Mid=(low+high)/2,Almid],\table[[Comparison],[no]]],[1,55,28,49,],[,,,,],[,,,,]]
Total no of comparisons:
b=80
\table[[low,high,Mid,A[mid],\table[[Comparison],[no]]],[1,55,28,49,],[,,,,],[,,,,],[,,,,],[,,,,],[,,,,]]
Total number of comparisons:
Activity III ( week 3 ) 1 5 pts Q 1 . Let A ( 1 .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!