Question #150839

Search the Value 125 from the following array using Binary Search algorithm. Show
the values of BEG, END and MID at each step.
11 22 30 33 40 44 55 60 66 77 80 88 99 125 150 200

Expert's answer

1) BEG=0,END=15,MID=7;60<125BEG = 0, END = 15, MID = 7; 60 < 125

2) BEG=8,END=15,MID=11;88<125BEG = 8, END = 15, MID = 11; 88 < 125

3) BEG=12,END=15,MID=13;125=125BEG = 12, END = 15, MID =13; 125 = 125

The value has been found.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS