##EXPLAIN STEP BY STEP AND FILL INTHE BLANKS##

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

##EXPLAIN STEP BY STEP AND FILL INTHE BLANKS##

Post by answerhappygod »

##EXPLAIN STEP BY STEP AND FILL INTHE BLANKS##
Explain Step By Step And Fill Inthe Blanks 1
Explain Step By Step And Fill Inthe Blanks 1 (457.27 KiB) Viewed 36 times
3. (10 points) Here is pseudocode which implementa binary search: procedure binary-search (: integer, as,..., increasing integers) - 1 (the left endpoint of the search interval) (the right endpoint of the search interval) while (i <j): if (x > ..) then: -m+1 else: - if (2-a) then: location - else: location : 0 return location Fill in the steps used by this implementation of binary search to find the location of 1 - 38 in the list ay - 17,ay - 22, a -25,04 -38, as - 40,00 -42, ay - 46, -54,4g - 59,00 - 61 • Step 1: Initially i- 1.9 - 10 so search interval is the entire list 41 - 17.03 - 22, a -25,04 -38, as - 40.06 - 42,01 - 46,- 54.0 = 59.41061 T- • Step 2: Since i- 1< -10, the algorithm enters the while loop. Using the values of and and so on From comparing and the updated values of i andre and- and so the new search interval is the sublist: . Step 3: Since the algorithm again enters the while loop again. Using the current values of rand : and so From comparing us and ... the updated values of i and are and) and so the new search interval is the sublist: . Step 4: Since: <. the algorithm again enters the while loop again. Using the current values of i andy: and so From comparing and the updated values of and are and so the new scarcli space in the sublist: Step 5: Since the algoritlu i tot enter the while loup. What does the algorithm do then, and what validees it round
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply