wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

NEW_SMP_Mls8_Quiz

Total questions: 18

Worksheet time: 11mins

Name
Class
Date
1.

What is an Algorithm?

a)

A chart showing the flow of a series of events

b)

A decision arrived at by following instructions

c)

Step-by-step instructions used to solve a problem

d)

A computer program that follows a chart

2.

Which of the following is NOT an algorithm?

a)
b)
c)
d)
3.

What should be considered when designing an algorithm?

a)

If the correct hardware is being used

b)

If the correct software is being used

c)

If there is more than one way of solving the problem

4.

Which of these pseudocode algorithms matches this flowchart?

a)

input a

b <- 1

c <- 1

IF (a>1)

d <- b + c

c <- b

d <- c

a <- a - 1

ENDIF

output c

b)

input a

b <- 1

WHILE (a>1)

d <- b + c

c <- b

d <- c

a <- a - 1

ENDWHILE

output c

c)

input a

b <- 1

c <- 1

WHILE (a>1)

d <- b + c

b <- c

c <- d

a <- a - 1

ENDWHILE

output c

d)

input a

b <- 1

c <- 1

IF (a>1)

d <- b + c

b <- c

c <- d

a <- a - 1

ENDIF

output c

5.

Some pseudocode to manipulate a numeric list is given below:


input list

a <- first_item_in_list

WHILE NOT end of list

b <- next item in the list

IF a > b

a <- b

ENDIF

ENDWHILE

output a

a)

average(list)

b)

max(list)

c)

min(list)

d)

search list for a

6.

A bubble sort algorithm will loop until?

a)

We have completed an entire run of comparing each item with the next in the list, and have made no changes during the run.

b)

We have compared each item with the item next to it and swapped them if needed.

c)

We have compared each item with each other item.

d)

We have made a number of swaps equal to the number of items in the list.

7.

Which sorting algorithm may make multiple swaps per pass?

a)

Bubble Sort

b)

Merge Sort

c)

Insertion Sort

8.

Which sorting algorithm relies on the Divide and Conquer strategy?

a)

Merge Sort

b)

Bubble Sort

c)

Insertion Sort

9.

Which of the following is not a sorting algorithm?

a)

Binary

b)

Linear

c)

Merge

d)

Bubble

10.

Which sorting algorithm is described by: moving through a list repeatedly, swapping elements that are in the wrong order.

a)

Merge

b)

Insertion

c)

Bubble

d)

None of the above

11.

How does Bubble Sort generally compare to Merge Sort?

a)

It is more efficient

b)

It is less efficient

c)

It is equally efficient

12.

Which type of lists or data sets are linear searching algorithms used for?

a)

Unsorted lists or data sets

b)

Sorted lists or data sets

13.

Select the best description to explain what a linear search algorithm is.

a)

Elements do not need to be in order, compare to the middle value, split the list in order, and repeat

b)

Put the elements in order, check each item in turn.

c)

Put the elements in order, compare with the middle value, split the list in order, and repeat.

d)

Elements do not need to be in order, check each item in turn.

14.

Select the best description to explain what a binary search algorithm is.

a)

Put the elements in order, check each item in turn.

b)

Elements do not need to be in order, compare to the middle value, split the list in order, and repeat

c)

Put the elements in order, compare with the middle value, split the list in order, and repeat.

d)

Elements do not need to be in order, check each item in turn.

15.

Describe an advantage of a linear search algorithm

a)

Data does not need to be in order.

b)

Can only work on an ordered list. If unordered must use a linear search.

c)

Slow with large data sets.

d)

Performs well over large ordered lists.

16.

A linear search is to be performed on the list:


[12, 6, 8, 1, 3]


How many comparisons would it take to find number 1?

a)

1

b)

2

c)

3

d)

4

17.

A binary search is to be performed on the list:


[1, 5, 10, 13, 48, 68, 100, 101]


How many comparisons would it take to find number 101?

a)

0-1

b)

1-2

c)

3-4

d)

4-5

18.

Describe an advantage of a binary search algorithm

a)

Data does not need to be in order.

b)

Can only work on an ordered list. If unordered must use a linear search.

c)

Slow with large data sets.

d)

Performs well over large ordered lists.