wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

IT6 (Finals) - Quiz 2

Total questions: 15

Worksheet time: 5mins

Name
Class
Date
1.

Which of the following is a primary reason why sorting data is important?

a)

It helps in random data access.

b)

It improves search efficiency, such as in binary search.

c)

It reduces the total memory footprint of the data.

d)

It encrypts data for secure storage.

2.

What is one of the key properties used to describe sorting algorithms?

a)

Portability

b)

Scalability

c)

Stability

d)

Versatility

3.

Which sorting algorithm repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order?

a)

Insertion Sort

b)

Selection Sort

c)

Merge Sort

d)

Bubble Sort

4.

What is the best-case time complexity for Bubble Sort when the list is already sorted?

a)

O(n^2)

b)

O(log n)

c)

O(n)

d)

O(n log n)

5.

Which characteristic best describes Bubble Sort for large datasets?

a)

Highly efficient

b)

Optimally space-efficient

c)

Highly inefficient

d)

Suitable for parallel processing

6.

In Selection Sort, how is the list conceptually divided during the sorting process?

a)

Into two halves based on value.

b)

Into a pivot and two sub-arrays.

c)

Into a sorted sublist and an unsorted sublist.

d)

Into blocks of equal size.

7.

A key difference between Selection Sort and Bubble Sort is that Selection Sort generally performs:

a)

More comparisons

b)

Fewer swaps

c)

More passes

d)

More memory allocations

8.

What is the time complexity for Selection Sort in its best, worst, and average cases?

a)

O(n) in best, O(n^2) in worst, O(n log n) in average

b)

O(n log n) in all cases

c)

O(n^2) in all cases

d)

O(n) in all cases

9.

Which sorting algorithm builds the final sorted array one item at a time by inserting each element into its correct position within the already sorted part?

a)

Bubble Sort

b)

Quick Sort

c)

Insertion Sort

d)

Heap Sort

10.

For what type of lists is Insertion Sort particularly efficient?

a)

Very large, randomly ordered lists

b)

Lists with duplicate elements

c)

Small lists or nearly sorted lists

d)

Lists stored in external memory

11.

What is the best-case time complexity for Insertion Sort?

a)

O(n^2)

b)

O(n log n)

c)

O(n)

d)

O(1)

12.

Which of the following is true regarding the stability of Bubble Sort and Insertion Sort?

a)

Both are unstable.

b)

Bubble Sort is stable, but Insertion Sort is unstable.

c)

Both are stable.

d)

Bubble Sort is unstable, but Insertion Sort is stable.

13.

What is the average and worst-case time complexity shared by Bubble Sort, Selection Sort, and Insertion Sort?

a)

O(n log n)

b)

O(n)

c)

O(n^2)

d)

O(log n)

14.

Why are Bubble Sort, Selection Sort, and Insertion Sort generally not suitable for very large datasets?

a)

They require excessive pre-processing.

b)

They have significant performance limitations due to their quadratic time complexity.

c)

They are complex to implement for large-scale systems.

d)

They consume too much auxiliary space.

15.

In what scenario might Insertion Sort be preferred over other O(n^2) algorithms?

a)

When the list is guaranteed to be completely unsorted.

b)

For lists with extremely large elements.

c)

For small arrays or nearly sorted arrays due to its low overhead.

d)

When the sorting must be performed in-place without any extra memory.