English

Differentiate Between Searching and Sorting. - Computer Applications

Advertisements
Advertisements

Question

Differentiate between searching and sorting.

Distinguish Between

Solution

S. No. Sorting Searching
1. Sorting is the rearrangement of elements in an array in a specific order. Searching is the process of looking for a specific element in an array of elements.
2. After sorting, the sorted elements will be in a different order than they were originally. The array's elements will remain in the same order following the search operation.
3. Sorting produces a sorted list of components.  The search results inform the user whether or not the item is in the array.
shaalaa.com
  Is there an error in this question or solution?
Chapter 3: Arrays (Single Dimensional and Double Dimensional) - EXERCISES [Page 240]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 3 Arrays (Single Dimensional and Double Dimensional)
EXERCISES | Q VI. 5. | Page 240

RELATED QUESTIONS

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.


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]


Using the switch statement, write a menu driven program to:
(i) To find and display all the factors of a number input by the user (including 1 and excluding number itself).

Example:
Sample Input: n=15
Sample Output: 1, 3, 5.
(ii) To find and display the factorial of a number input by the user (the factorial of a non-negative integer n, denoted by n\ is the product of all integers less than or equal to n.
Example:
Sample Input: n=5
Sample Output: 5! = 1×2×3×4×5 = 120.
For an incorrect choice, an appropriate error message should be displayed.


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 10 characters from a user. Using bubble sort technique arrange them in ascending order. Display the sorted array and original array.


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".


Define a class to search for a value input by the user from the list of values given below. If it is found display the message "Search successful", otherwise display the message "Search element not found” using Binary search technique.

5.6, 11.5, 20.8, 43.1, 52.4, 66.6, 78.9, 80.0, 95.5.


Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×