YOU CAN DOWNLOAD 200+ SUBJECTS PDF BOOK FOR COMPETITIVE EXAMINATIONS
Timsort Multiple choice Questions and Answers (MCQs)
Question 1 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |
Which of the following is Python's standard sorting algorithm?
quick sort | |
introsort | |
merge sort | |
tim sort |
Question 1 Explanation:
Tim sort has been python's standard sorting algorithm since its version 2.3. It is an example of hybrid sorting algorithm which means it uses more than one sorting algorithm as a routine.
Question 2 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |
Which of the following sorting algorithm is a constituent of tim sort?
selection sort | |
quick sort | |
merge sort | |
heap sort |
Question 2 Explanation:
Tim sort is a hybrid sorting algorithm which means it uses more than one sorting algorithm as a routine. It is derived from insertion sort and merge sort.
Question 3 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |
Tim sort begins sorting the given array by using which of the following sorting algorithm?
selection sort | |
quick sort | |
insertion sort | |
merge sort |
Question 3 Explanation:
Tim sort begins sorting any given array by using insertion sort for each run. The array is divided into smaller parts for this purpose, each part having a size equal to value of run. Then these small parts called runs are merged in order to obtain sorted array.
Question 4 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |
Which of the following sorting algorithm is stable?
Tim sort | |
Introsort | |
Quick sort | |
Heap sort |
Question 4 Explanation:
Out of the given options Tim sort is the only algorithm which is stable. As both constituents of Tim sort (I.e insertion sort and merge sort) are stable so Tim sort also becomes stable.
Question 5 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |
Which of the following sorting algorithm is not in-place?
insertion sort | |
tim sort | |
quick sort | |
intro sort |
Question 5 Explanation:
Tim sort is not an in-place sorting algorithm as it requires auxiliary space. It is because it requires to merge sorted runs which requires a third array of the size equal to the sum of the two runs.
There are 5 questions to complete.