Translate

Visit to www.mrmcse.com

10 March 2018

What are the differences between linear search and binary search



Linear Search
Binary Search
(i) Linear search doesn’t require the input data to be stored.
(i) Binary search requires the input data to be stored.
(ii) Linear search only requires equality comparisons.
(ii) Binary search an ordering comparisons.
(iii) Linear search only requires sequential access.
(iii) Binary search requires random access to the data.
(iv) Linear search has complexity O(n).
(iv) Binary search has complexity O (log n).
(v) Single / multi-dimensional array used.
(v) Only single dimensional array used.
(vi) Any relation operator used.
(vi) Only “=” relation operator is used.
(vii) Access is low.
(vii) Access is faster.




No comments:

Post a Comment