Page 348 - Cs_withBlue_J_C11_Flipbook
P. 348
8. Which of the following is the fastest searching technique?
a. Bubble sort b. Selection sort
c. Insertion sort d. None of these
9. In which sorting technique, the smallest element is searched and interchanged with the first element?
a. Bubble sort b. Selection sort
c. Insertion sort d. None of these
10. Which of the following arrays contains a combination of rows and columns?
a. Single dimensional array b. Double dimensional array
c. Both a and b d. None of these
Answers
1. b 2. a 3. d 4. c 5. b 6. c 7. a 8. c 9. b 10. b
B. Fill in the blanks:
1. ………………… technique compares the element with the next element and swaps if the given condition matches.
2. ………………… contains multiple rows and multiple columns.
3. Execution is ………………… in binary search with respect to linear search.
4. Finding an element in the array is called ………………… .
5. ………………… is a technique of adding an element to the array.
6. ………………… is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half.
7. In …………………, the consecutive elements are checked from the beginning.
8. An array is a ………………… data type.
9. ………………… element is represented by a[5].
10. ………………… is the process of combining two or more arrays.
Answers
1. Bubble sort 2. Double-dimensional array 3. faster 4. Searching 5. Insertion
6. Binary search 7. Linear search 8. Composite 9. Sixth 10. Merging
C. Answer the following questions:
1. What is an array?
Ans. Arrays can be defined as a set of variables that contains values of the same data types having the same variable name but
different subscripts required to separate the values. Thus, an array is a composite data type.
2. What is binary search? How does it work?
Ans. Binary search is a process of finding an element in an array. In binary search, firstly, the array is arranged in ascending or descending
order. Then the sorted array (in ascending order) is divided into two equal halves. The element to be searched is checked with
the middle element. If it matches, then the loop breaks, else it checks whether the searched element is larger or smaller than
the middle element. If it is smaller than the middle element, then the left side is again divided into two halves and the process
continues.
3. What is selection sort technique? Explain its working.
Ans. Selection sort is a technique to arrange the elements of an array is ascending or descending order. Using this technique, the
smallest element is first found and then the first element is interchanged with the smallest element. Thus, the first element after
one iteration is the smallest. Then the second element is compared and interchanged with the second smallest element and
swapped, if required. This procedure keeps on continuing with every element being compared, till the list finally gets sorted.
4. What is insertion in an array?
Ans. Insertion is the process of adding an element at any desired position in the array.
5. What is deletion in an array? How does it work?
Ans. Deletion is the process of deleting or removing an element from the array from the given position. In this technique, the index
position is taken from the user and then the value found at that index is deleted. Also, the number to be deleted can also be taken
from the user. In that case, the given number is first checked (for its presence in the array) using any searching technique, and
then, if it is there in the array it is deleted.
346346 Touchpad Computer Science-XI

