How is linear search different from binary search?
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Binary search requires the input data to be sorted near search doesn’t.
2. Binary search requires an ordering comparison; linear search only requires equality comparisons
3. Binary search has complexity 0(log n); linear search has complexity O(n) as discussed earlier.
4. Binary search requires random access to the data; linear search only requires sequential access (this can be very important – it means a linear search can stream data of arbitrary size).