wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CSNP-04103 - Chapter 9 - NB - Search and Sort Algorithms

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which algorithm matches this description: "a sorting algorithm that treats the input as two parts, a sorted part and an unsorted part, and repeatedly selects the proper next value to move from the unsorted part to the end of the sorted part."

a)

Selection Sort

b)

Radix Sort

c)

Insertion Sort

d)

Binary Sort

2.

Which algorithm matches the description: "is an efficient algorithm for finding an item from a sorted list of items. It works by repeatedly dividing in half the portion of the list that could contain the item, until you've narrowed down the possible locations to just one."

a)

Linear Search

b)

Binary Search

c)

Bubble Search

d)

Straight Search

3.

Which algorithm matches the description: "is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted."

a)

Selection Sort

b)

Binary Sort

c)

Bubble Sort

d)

Big O()

4.

What is the degree of complexity ( Big O() )  of the linear search algorithm?.

a)

 O(nn)O\left(n^n\right)  

b)

O(n log 2)

c)

 O(n2)O\left(n^2\right)  

d)

O(n)

5.

What is a disadvantage of the binary search algorithm?

a)

The elements to search needs to be sorted first.

b)

The elements to search do not have to be sorted

c)

Difficult to understand and implement

d)

It uses recursion

6.

What is the correct statement about selection sort?.

a)

Can sort alphabetically, and numerically (ascending or descending)

b)

Can only sort numeric (ascending or descending)

c)

Can only sort alphabetically

d)

None of the above

7.

What is a disadvantage of the bubble sort algorithm?

a)

Easy to understand and implement

b)

It is inefficient due to the number of exchanges.

This makes it slow for large arrays

c)

Sometimes it does not work

d)

Elements need to be sorted in order to be used.

8.

What is the degree of complexity ( Big O() ) for the Bubble sort algorithm?.

a)

O(n2)O\left(n^2\right)

b)

O(n)O\left(n\right)

c)

O(2n)O\left(2n\right)

d)

O(N log 2)O\left(N\ \log\ 2\right)

9.

The efficiency of an algorithm is measured in terms of space and time.

a)

True

b)

False

10.

Analysis of an algorithm is a less effective way to find efficiencies than using empirical data

a)

True

b)

False