Linear vs Binary Search
Linear search examines elements sequentially and works on unsorted data. Binary search repeatedly halves the search interval and requires sorted data with efficient random access. Linear search takes O(n) time, while binary search takes O(log n) time.
Linear search: O(n).
Binary search: O(log n).
Binary search requires sorted data.
Binary search is naturally suited to arrays with random access.