184k views
3 votes
>>The following questions refer ONLY to the binary search algorithm presented in class and in the Rosen textbook.<< Suppose that an element is known to be among the first four elements in an ordered list of 32. Would a linear search or a binary search locate this element more rapidly? Choose... - Now suppose it is known to be among the 5th through 8th elements in a list of 32 elements. On average, which search would be faster (in terms of number of comparisons)? Choose... - Choose. Linear Search Binary Search ment is known to be among the first brdered list of 32. What is the worst

User Kamikaze
by
8.3k points

1 Answer

5 votes

Answer:

1) Linear search

because linear search takes 4 comparisons in worst case while binary search takes 5

2) Binary search

because binary search takes 5 comparisons in worst case while linear search takes from 5 to 8.

Step-by-step explanation:

User Silver Zachara
by
8.3k points