Question: Mergesort is a stable algorithm but not an in-place algorithm?
- 1. True
- 2. False
- 3. NA
- 4. NA
Question: Which of the following sorting algorithms is stable? (i) Merge sort (ii) Quick sort (iii) Heap sort (iv) Counting Sort?
- 1. Only I
- 2. Only ii
- 3. Both i and ii
- 4. Both iii and iv
Question: It requires more complicated data structures, Prim’s algorithm for a minimum spanning tree is better than Kruskal’s when the graph has a large number of vertices?
- 1. True
- 2. False
- 3. NA
- 4. NA
Question: Quick sort is based on divide and conquer paradigm; we divide the problem on base of pivot element and?
- 1. There is explicit combine process as well to conquer the solutin
- 2. No work is needed to combine the sub-arrays, the array is already sorted
- 3. Merging the subarrays
- 4. None of above
Question: Quick sort is __.
- 1. Stable & in place
- 2. Not stable but in place
- 3. Stable but not in place
- 4. Some time stable & some times in place
Question: One example of in place but not stable algorithm is?
- 1. Merger Sort
- 2. Quick Sort
- 3. Continuation Sort
- 4. Bubble Sort
Question: In stable sorting algorithm?
- 1. If duplicate elements remain in the same relative position after sorting
- 2. One array is used
- 3. More than one arrays are required
- 4. Duplicating elements not handled
Question: Continuation/counting sort is suitable to sort the elements in range 1 to k?
- 1. K is Large
- 2. K is not known
- 3. K may be small or large
- 4. K is small
Question: An in place sorting algorithm is one that uses __ arrays for storage.
- 1. Two dimensional arrays
- 2. More than one array
- 3. No Additional Array
- 4. None of the above
Question: In counting sort, once we know the ranks, we simply __ numbers to their final positions in an output array.
- 1. Delete
- 2. Copy
- 3. Mark
- 4. arrange