NEW
Font size
WorksheetsDAA Quiz ( 3 Sept 2020)
Total questions: 5
Worksheet time: 4mins
What is recurrence for worst case of QuickSort and what is the time complexity in Worst case?
Recurrence is T(n) = T(n-2) + O(n) and time complexity is O(n^2)
Recurrence is T(n) = T(n-1) + O(n) and time complexity is O(n^2)
Recurrence is T(n) = 2T(n/2) + O(n) and time complexity is O(nLogn)
Recurrence is T(n) = T(n/10) + T(9n/10) + O(n) and time complexity is O(nLogn)
Which of the following is not a stable sorting algorithm in its typical implementation.
Insertion Sort
Merge Sort
Quick Sort
Bubble Sort
Which of the following is not true about comparison based sorting algorithms?
The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input array
Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are compared
Counting Sort is not a comparison based sorting algortihm
Heap Sort is not a comparison based sorting algorithm.
Suppose we are sorting an array of eight integers using quicksort, and we have just finished the first partitioning with the array looking like this:
2 5 1 7 9 12 11 10
The pivot could be either the 7 or the 9
The pivot could be the 7, but it is not the 9
The pivot is not the 7, but it could be the 9
Neither the 7 nor the 9 is the pivot.
How many sub arrays does the quick sort algorithm divide the entire array into?
one
two
three
four
