Explore topic-wise MCQs in Testing Subject.

This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of the following is not an exchange sort?

A. Bubble Sort
B. Quick Sort
C. Partition-exchange Sort
D. Insertion Sort
Answer» E.
2.

In insertion sort, the average number of comparisons required to place the 7th element into its correct position is ____

A. 9
B. 4
C. 7
D. 14
Answer» C. 7
3.

Statement 1: In insertion sort, after m passes through the array, the first m elements are in sorted order.Statement 2: And these elements are the m smallest elements in the array.

A. Both the statements are true
B. Statement 1 is true but statement 2 is false
C. Statement 1 is false but statement 2 is true
D. Both the statements are false
Answer» C. Statement 1 is false but statement 2 is true
4.

Consider an array of length 5, arr[5] = {9,7,4,2,1}. What are the steps of insertions done while running insertion sort on the array?

A. 7 9 4 2 1 xa0 xa0 xa0 t4 7 9 2 1 xa0 xa0 xa0 t2 4 7 9 1 xa0 xa0 xa0 t1 2 4 7 9
B. 9 7 4 1 2 xa0 xa0 xa0 t9 7 1 2 4 xa0 xa0 xa0 t9 1 2 4 7 xa0 xa0 xa0 t1 2 4 7 9
C. 7 4 2 1 9 xa0 xa0 xa0 t4 2 1 9 7 xa0 xa0 xa0 t2 1 9 7 4 xa0 xa0 xa0 t1 9 7 4 2
D. 7 9 4 2 1 xa0 xa0 xa0 t2 4 7 9 1 xa0 xa0 xa0 t4 7 9 2 1 xa0 xa0 xa0 t1 2 4 7 9
Answer» B. 9 7 4 1 2 xa0 xa0 xa0 t9 7 1 2 4 xa0 xa0 xa0 t9 1 2 4 7 xa0 xa0 xa0 t1 2 4 7 9
5.

Which of the following is good for sorting arrays having less than 100 elements?

A. Quick Sort
B. Selection Sort
C. Merge Sort
D. Insertion Sort
Answer» E.
6.

Insertion sort is an example of an incremental algorithm.

A. True
B. False
Answer» B. False
7.

The worst case time complexity of insertion sort is O(n2). What will be the worst case time complexity of insertion sort if the correct position for inserting element is calculated using binary search?

A. O(nlogn)
B. O(n<sup>2</sup>)
C. O(n)
D. O(logn)
Answer» C. O(n)
8.

Which of the following sorting algorithm is best suited if the elements are already sorted?

A. Heap Sort
B. Quick Sort
C. Insertion Sort
D. Merge Sort
Answer» D. Merge Sort
Previous Next