ICSE Class 10 Computer Applications Question 29 of 59

Arrays — Question 31

Back to all questions
31
Question

Question 25

What is the difference between linear search and binary search ?

Answer
Linear SearchBinary Search
Linear search works on sorted and unsorted arrays.Binary search works only on sorted arrays (both ascending and descending).
Each element of the array is checked against the target value until the element is found or end of the array is reached.Array is successively divided into 2 halves and the target element is searched either in the first half or in the second half.
Linear Search is slower.Binary Search is faster.