All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 07 · MOCK TEST

Mock 5 – Sorting & Searching

Unit 7: Data Structures and Algorithms · 19 questions · about 22 minutes. Press End Mock any time to see your score and the correct answers.

All 11 topic-wise mocks in this unit
0 / 19 answered 00:00
Q1. Match List - I with List - II.
List - IList - II
A. Merge sortI. n²
B. Binary searchII. nlogn
C. Quick sortIII. n
D. Search in an unsorted arrayIV. logn
Choose the correct answer from the options given below:
Q2. In the worst case, the smallest number of comparisons required by any sorting algorithm, which does only binary comparisons, is
Q3. A binary search tree is obtained by inserting the words "Mathematics", "Physics", "Geography", "Zoology", "Metrology", "Geology", "Psychology" and "Chemistry" in order. Words are compared by dictionary order. Arrange the following words in increasing order of their level in the tree.
A. Mathematics
B. Zoology
C. Psychology
D. Physics
Choose the correct answer from the options given below:
Q4. Which of the following is NOT a divide and conquer method?
Q5. Match List I with List II
List IList II
A. Insertion SortI. O(log n)
B. Binary SearchII. O(n²)
C. Quick SortIII. O(n)
D. Selection SortIV. O(n log n)
Q6. Select the sorting algorithms that are stable.
(A) Quick Sort
(B) Bubble Sort
(C) Insertion Sort
(D) Merge Sort
(E) Shell Sort
Choose the correct answer from the options given below:
Q7. f(n) = a·f(n/b) + g(n) is a divide-and-conquer recurrence. Match the algorithms in List I with their recurrences in List II.
List IList II
A. Binary SearchI. f(n) = 7f(n/2) + 15n²/4
B. Find maximum and minimum of a sequenceII. f(n) = 2f(n/2) + n
C. Merge SortIII. f(n) = 2f(n/2) + 2
D. Fast Matrix MultiplicationIV. f(n) = f(n/2) + 2
Q8. Arrange the following search and sort algorithms in ascending order of their worst-case complexities:
A. Merge sort
B. Linear search
C. Bubble sort
D. Binary search
Choose the correct answer from the options given below:
Q9. Which algorithm design approach is used in the quick sort algorithm?
Q10.

Match the LIST-I with LIST-II

Figure
Q11.

Select the Sorting Algorithms that are stable.

(A) Quick Sort

(B) Bubble Sort

(C) Insertion Sort

(D) Merge Sort

(E) Shell Sort

Q12.

Match List - I with List - II. f(n) = a f(n / b) + g(n) is a divide-and- conquer recurrence relation for the Listed-I algorithms, match their recurrence in Listed-II.

Figure
Q13.

Two balanced binary trees are given with m and n elements, respectively. They can be merged into a balanced binary search tree in ____ time.

Q14.

There are many sorting algorithms based on comparison. The running time of heapsort O(n lg n) P Q algorithm is . Like , but unlike , (P, Q) heapsort sorts in place where is equal to

Q15.

Which of the following is best running time to n n2 − 1 sort integers in the range 0 to ?

Q16.

Which of the following is application of depth- first search?

Q17.

The second smallest of n elements can be found with ____________ comparisons in the worst case.

Q18.

A text is made up of the characters A, B, C, D, E each occurring with the probability 0.08, 0.40, 0.25, 0.15 and 0.12 respectively. The optimal coding technique will have the average length of :

Q19.

The maximum number of comparisons needed to sort 9 items using radix sort is (assume each item is 5 digit octal number) :