wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz No. 3 (Finals)

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.
Which type of sort algorithm is this?
a)
Insertion
b)
Bubble
c)
Merge
2.
A merge sort requires both lists of data to be in the correct order
a)
True
b)
False
3.
Merge Sort is?
a)
When a list is kept as one and compared
b)
List is split into 2 and merged together
c)
List is split into 2 and kept seperate
d)
Nothing
4.

is an algorithm that first sorts the elements far apart from each other and successively reduces the interval between the elements to be sorted. It is a generalized version of insertion sort

a)

Shell Sort

b)

Merge Sort

c)

Quick Sort

5.

In shell sort, elements at a specific interval are sorted. The interval between the elements is gradually decreased based on the sequence used.

a)

True

b)

False

6.

What is shell's original sequence?

a)

1, 4, 13, …, (3k – 1) / 2

b)

N/2 , N/4 , …, 1

c)

1, 8, 23, 77, 281, 1073, 4193, 16577...4j+1+ 3·2j+ 1

d)

1, 3, 5, 9, 17, 33, 65,...

7.

In shell sort, we compare elements that are distant apart and rather than adjacent.

a)

True

b)

False

8.

What is the best case complexity of shell sort?

a)

O(n*log n)

b)

O(n2)

c)

O(xn*log n2)

d)

O(2*log n)

9.

is a recursive algorithm that continually splits a list in half. If the list is empty or has one item, it is sorted by definition (the base case).

a)

Shell Sort

b)

Merge Sort

c)

Quick Sort

10.

is the process of taking two smaller sorted lists and combining them together into a single, sorted, new list.

a)

Sorting

b)

Merging

c)

Separating

11.

When using this technique, we divide a problem into subproblems. When the solution to each subproblem is ready, we 'combine' the results from the subproblems to solve the main problem.

a)

Divide Technique

b)

Divide and Conquer Technique

c)

Split and Combine Technique

d)

Combine Technique

12.

In merge sort, The algorithm maintains two pointers, one for each of the two arrays and one for maintaining the current index of final sorted array.

a)

True

b)

False

13.

uses divide and conquer to gain the same advantages as the merge sort, while not using additional storage. As a trade-off, however, it is possible that the list may not be divided in half.

a)

Shell Sort

b)

Merge Sort

c)

Quick Sort

14.

A quick sort first selects a value, which is called the

a)

variable x

b)

x value

c)

pivot value

d)

variable of pivot

15.

The actual position where the pivot value belongs in the final sorted list, commonly called the combine point, will be used to divide the list for subsequent calls to the quick sort.

a)

True

b)

False

16.

A pivot element is chosen from the array. You can choose any element from the array as the pivot element.

a)

True

b)

False

17.

The array is divided into subparts taking pivot as the partitioning point. The elements smaller than the pivot are placed to the left of the pivot and the elements greater than the pivot are placed to the right.

a)

Divide

b)

Conquer

c)

Combine

18.

The left and the right subparts are again partitioned using the by selecting pivot elements for them. This can be achieved by recursively passing the subparts into the algorithm

a)

Divide

b)

Conquer

c)

Combine

19.

This step does not play a significant role in quicksort. The array is already sorted at the end of the conquer step.

a)

Divide

b)

Conquer

c)

Combine

20.

What is the worst-case complexity of Quick Sort?

a)

O(n2)

b)

O(n*log n)

c)

O(2*log n)

d)

O(n2)^2