Page 324 - computer science (868) class 11
P. 324
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.
Unsolved Questions
A. Tick ( ) the correct answer:
1. Which of the following is the correct statement to declare and initialise an array?
a. int ar[ ] = [3, 5, 7]; b. int[ ] ar = [3, 5, 7];
c. int ar[ ] = {3, 5, 7}; d. int [ ] ar = {3, 5, 7};
2. Binary search is also known as ………………… .
a. Middle search b. Half search
c. Half-interval search d. Middle-interval search
3. We use the array name and the element’s ………………… to access the element.
a. data type b. subscript
c. name d. value
4. Which of the following statements can be used to create a one-dimensional array ar of size 5 with double type values?
a. double [5] ar; b. double [5] = ar;
c. double ar[] = ar[5]; d. double ar[5];
5. The ………………… sort usually performs less interchanges than the ………………… sort.
a. bubble, insertion b. bubble, selection
c. selection, bubble d. selection, insertion
322322 Touchpad Computer Science-XI

