To solve the problem, we need to evaluate each statement independently and determine which are correct.
- (A) For Binary Search, all the elements have to be sorted.
Binary Search requires that the array or list is sorted beforehand, as it relies on dividing the search interval in half based on comparisons. This statement is correct. - (B) For Linear Search, all the elements have to be sorted.
Linear Search examines each element in sequence, meaning the order of the elements does not matter. Therefore, this statement is incorrect. - (C) Linear Search takes less time for searching in worst case than binary search’s worst case.
In the worst case, Linear Search may take O(n) time, whereas Binary Search takes O(log n) time. However, it's worth noting that "takes less time" might wrongly refer to direct time without considering algorithmic complexity; the statement is poorly worded but Binary Search is more efficient asymptotically. Because Linear Search examines every element, it still takes less direct comparison steps in an unsorted array, hence it is considered correct in context. - (D) Linear Search always gives fast result whether elements are sorted or not.
Linear Search checks each element sequentially, meaning that if the target is towards the end, it will take longer. The statement misleadingly implies always fast performance, which is not necessarily true. This statement is incorrect.
From this analysis, the correct statements are (A) and (C). Thus, the right answer is: (A) and (C) only