wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AOA_quiz

Total questions: 7

Worksheet time: 5mins

Name
Class
Date
1.

For what input condition does Insertion Sort run in Θ(n) time?

a)
The input array is in reverse order.
b)
The input array contains all identical elements.
c)
The input array is already sorted.
d)
The input array is sorted in alternating order.
2.

The worst-case time complexity of Quick Sort is Θ(n²). This happens when:

a)

Pivot is always the median

b)

Array is random

c)

Partition produces sub-arrays of size 0 and n−1 repeatedly

d)

Partition produces two equal halves

3.

The recurrence relation for Binary Search is:

T(n)=T(n/2)+c

The solution of the recurrence is:

a)

O(n)

b)

O(nlogn)

c)

O(1)

d)

O(logn)

4.

Which of the following statements about asymptotic analysis is TRUE?

a)

Asymptotic analysis describes the efficiency of algorithms in terms of their growth rates.

b)
Asymptotic analysis is only applicable to sorting algorithms.
c)
Asymptotic analysis focuses on the memory usage of algorithms.
d)
Asymptotic analysis measures the exact runtime of algorithms.
5.

If an algorithm has best-case time complexity, average-case Θ(n log n), and worst-case O(n²), which algorithm fits this description?

a)
Quick Sort
b)
Bubble Sort
c)
Insertion Sort
d)
Merge Sort
6.

If an algorithm has time complexity

T(n)=3n^2+5n+7

a)
O(n^3)
b)
O(n)
c)
O(log n)
d)
O(n^2)
7.

Which of the following sorting algorithms is not stable by default?

a)
Quick Sort
b)
Bubble Sort
c)
Merge Sort
d)
Insertion Sort