Why binary search algorithm is more efficient than the linear-00930

Online Quiz This subjective question is related to the book/course vu cs601 Data Communication. It can also be found in vu cs601 Mid Term Solved Past Paper No. 1.

Question 1: Why binary search algorithm is more efficient than the linear search algorithm?
Answer:
Binary search algorithm is more efficient than liner algorithm because the arrays are sorted in asending or desending order and we use "devide and conqrer" technique. In binary search each iteration reduces the search by the factor of two but in the linear we have the same number of searches as we have the number of elements.e.g,if we have array of 1000 elements the linear search will take 1000 iterations however binary search will take max 10. (page 118)

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background