CDS Q3
CDS Q3
SORTING (Set: 1)
1. The number of swappings needed to sort the numbers: 8, 22, 7, 9, 31, 19, 5, 13 in ascending
order using bubble sort is—
(a) 11 (b) 12
(c) 13 (d) 14
2. Given 2 sorted list of size ‘m’ and ‘n’ respectively. The no. of comparisons needed in the
worst case by the merge sort algorithm will be—
3. The average successful switch time taken by binary search on a sorted array of 10 items is—
4. The average successful search time for sequential search on ‘n’ items is—
(a) Internal sorting is used if the no. of items to be sorted is very large
(b) External sorting is used if the no. of items to be sorted is very large
1
(c) External sorting needs auxiliary storage
(d) Internal sorting needs auxiliary storage
7. A sorting technique that generates that records with the same primary key occurs in the same
order in the sorted list as in the original unsorted list is said to be—
8. The way a card game player arranges his cards as he picks them up one by one, is an example
of—
9. You want to check whether a given set of items is sorted. Which of the following sorting
methods will be the most efficient if it is already in sorted order?
10. The average no. of comparisons performed by the merge sort algorithm, in merging 2 sorted
lists of length 2 is—
(a) 8/ 3 (b) 8/ 5
(c) 11/ 7 (d) 11/ 6
11. Which of the following sorting methods will be the best if no. of swapping done, is the only
measure of efficiency?
13. As part of maintenance work, you are entrusted with the work of rearranging the library
books in a shelf in proper order, at the end of each day. The ideal choice will be—
14. The max. no. of comparisons needed to sort 7 items using radix sort is (assume each item is a
4 digit decimal number)
15. Which of the following algorithm exhibits the unnatural behaviour that, minimum no. of
comparisons are needed if the list to be sorted is in the reverse sorted order and maximum no. of
comparisons are needed if they are already in sorted order?
16. Which of the following sorting algorithm has the worst time complexity of nlog(n) ?
3
17. Merge sort uses—
18. For merging 2 sorted lists of size m and n into a sorted list of size m + n, we require
comparisons of—
19. Which of the following design technique is used in the quick sort?