How is linear search different from binary search?
Answers
Answered by
1
in linear searching data elements are searched one by one with all the element present in dataeven if the element is found... but in binary search the data is divided in to two parts and then compared with middle element......
Answered by
3
Here are some differences listed below :↝
☞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).
╧╤╧╤╧╤╧╤╧╤╧╤╧╤╧╤╧╤╧╤╧╤╧╤╧╤
彡★ Thank You For Asking ★彡
↬↬
Similar questions
Social Sciences,
7 months ago
Physics,
7 months ago
English,
7 months ago
Business Studies,
1 year ago
Biology,
1 year ago