मराठी

What is the Difference Between the Linear Search and the Binary Search Technique? - Computer Applications

Advertisements
Advertisements

प्रश्न

What is the difference between the linear search and the binary search technique?

Differentiate between the following:

Linear search and Binary search.

Write one difference between Linear Search and Binary Search. 

फरक स्पष्ट करा
Advertisements

उत्तर

S. No. Linear Search Binary Search
1. Linear search works both for sorted and unsorted data.  Binary search works on sorted data (either in ascending order or in descending order).
2. Linear search begins at the start of an array, i.e., at 0th position.  This technique divides the array into two halves, and the desired data item is searched in each half.
shaalaa.com

Notes

Students should refer to the answer according to their questions. 

  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 3: Arrays (Single Dimensional and Double Dimensional) - EXERCISES [पृष्ठ २४०]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
पाठ 3 Arrays (Single Dimensional and Double Dimensional)
EXERCISES | Q VI. 6. | पृष्ठ २४०
अविचल Computer Applications [English] Class 10 ICSE
पाठ 3 Arrays (Single Dimensional and Double Dimensional)
Review Insight | Q 5. | पृष्ठ २३६

संबंधित प्रश्‍न

Write a program to input 15 integer elements in an array and sort them in ascending order using the bubble sort technique. 


Design a class to overload a function series() as follows: 

(a) void series (int x, int n) – To display the sum of the series given below:
x1 + x2 + x3 + ……………. xn terms

(b) void series (int p) – To display the following series:
0, 7, 26, 63 p terms.

(c) void series () – To display the sum of the series given below:

`1/2 + 1/3 + 1/4 .....1/10`


Name the following :
(i) A keyword used to call a package in the program.
(ii) Any one reference data type.


Differentiate between searching and sorting.


If int x [ ] = { 4, 3,7, 8, 9,10}; what are the values of p and q ?

(i) p = x.length
(ii) q = x[2] + x[5] * x[1]


Write a program to accept a name and total marks of N number of students in two single subscript array name[] and totalmarks[].

Calculate and print:

  1. The average of the total marks obtained by N Number of students.
    [average = (sum of total marks of all the students)/N]
  2. Deviation of each student’s total marks with the average
    [deviation = total marks of a student – average] 

Find the errors in the given program segment and re-write the statements correctly to assign values to an integer array.
int a = new int (5);
for (int i = 0; i < = 5; i++) a [i] = i;


Consider the given array and answer the question given below:

int x[ ] {4; 7,9,66,72,0,16);

What is the length of the array?


Consider the given array and answer the question given below:

int x[ ] {4; 7,9,66,72,0,16);

What is the value in x[4]?


Define a class to accept values into an array of double data type of size 20. Accept a double value from user and search in the array using linear search method. If value is found display message "Found" with its potiition where it is present in the array. Otherwise display message "not found".


Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×