Suppose that an element is known to be among the first four elements in a list of 32 elements. Would a linear search or a binary search locate this element more rapidly?

SolutionStep 1In this problem, we have to show that which algorithm is better linear search or binary search.