Question: *no need to do the code, just draw out* 1. Consider the following list: s, u, b, d, e, r, m, a, t, o, g,

*no need to do the code, just draw out*

1. Consider the following list: s, u, b, d, e, r, m, a, t, o, g, l, y, p, h, I, c

i) Using the sequential search algorithm, show the steps to find the following items. How many comparisons are required to find whether the items are in the list?

a) m

b) f

ii) Using the binary search algorithm, show the steps to find the following items. How many comparisons are required to find whether the items are in the list? Show the values of first, last and middle and the number of comparisons after each iteration of the loop.

a) c

b) f'

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 Databases Questions!