wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

DAA Quiz ( 3 Sept 2020)

Total questions: 5

Worksheet time: 4mins

Name
Class
Date
1.

What is recurrence for worst case of QuickSort and what is the time complexity in Worst case?

a)

Recurrence is T(n) = T(n-2) + O(n) and time complexity is O(n^2)

b)

Recurrence is T(n) = T(n-1) + O(n) and time complexity is O(n^2)

c)

Recurrence is T(n) = 2T(n/2) + O(n) and time complexity is O(nLogn)

d)

Recurrence is T(n) = T(n/10) + T(9n/10) + O(n) and time complexity is O(nLogn)

2.

Which of the following is not a stable sorting algorithm in its typical implementation.

a)

Insertion Sort

b)

Merge Sort

c)

Quick Sort

d)

Bubble Sort

3.

Which of the following is not true about comparison based sorting algorithms?

a)

The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input array

b)

Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are compared

c)

Counting Sort is not a comparison based sorting algortihm

d)

Heap Sort is not a comparison based sorting algorithm.

4.

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

a)

The pivot could be either the 7 or the 9

b)

The pivot could be the 7, but it is not the 9

c)

The pivot is not the 7, but it could be the 9

d)

Neither the 7 nor the 9 is the pivot.

5.

How many sub arrays does the quick sort algorithm divide the entire array into?

a)

one

b)

two

c)

three

d)

four