Computer Applications
What is the difference between the linear search and the binary search technique?
Java Arrays
ICSE 2019
31 Likes
Answer
| Linear search | Binary search |
|---|---|
| Linear search works on sorted and unsorted arrays. | Binary search works on only sorted arrays. |
| In Linear search, each element of the array is checked against the target value until the element is found or end of the array is reached. | In Binary search, 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. |
Answered By
18 Likes
Related Questions
Name the below structure:

- One dimensional array
- Two Dimensional array with 4 rows and 5 columns
- Three dimensional array
- Two Dimensional array with 5 rows and 4 columns
The statement used to find the total number of Strings present in the string array String s[] is:
- s.length
- s.length()
- length(s)
- len(s)
Consider the following two-dimensional array and answer the questions given below:
int x[ ][ ] = {{4,3,2}, {7,8,2}, {8, 3,10}, {1, 2, 9}};(a) What is the order of the array?
(b) What is the value of x[0][0]+x[2][2]?