wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Algorithms Study Set

Total questions: 70

Worksheet time: 59mins

Name
Class
Date
1.

Speedup is when programs run in order, one command at a time.

a)

True

b)

False

2.

Sequential computing is a type of computation where many calculations are carried out simultaneously.

a)

True

b)

False

3.

A computer scientist is analyzing four different algorithms used to sort a list. The table below shows the number of steps each algorithm took to sort lists of different sizes.

Based on the values in the table, which of the algorithms appear to run in reasonable time?

a)

A

b)

B

c)

C

d)

D

4.

Which algorithm will be most useful to guess the number that someone has in their head spanning from 1-100?

a)

Binary

b)

Linear

5.

If one would like to read through a large list of names and read every name on the list, which big O notation would you use?

a)

O(nlog n)

b)

O(nlog n)

c)

O(n!)

d)

O(n)

6.

A sorted list of numbers contains 200 elements. Which of the following is closest to the maximum number of list elements that will need to be examined when performing a binary search for a particular value in the list?

a)

8

b)

10

c)

2

d)

200

7.


A town government is designing a new bus system and are deciding where to put the different bus stops. They want to pick the collection of locations that minimizes the distance anyone needs to walk in order to get to at least one bus stop. What term best defines the kind of problem?

a)

A decision problem


b)

An optimization problem

c)

An undecidable problem

d)

An efficiency problem

8.

        Which of the following best describes the ability of parallel computing solutions to improve efficiency?

a)

 

Any problem that can be solved sequentially can be solved using a parallel solution in approximately half the time.

b)

Any solution can be broken down into smaller and smaller parallel portions, making the improvement in efficiency theoretically limitless as long as there are enough processors available.

c)

The efficiency of parallel computing solutions is rarely improved over the efficiency of sequential computing solutions.

d)

The efficiency of a solution that can be broken down into parallel portions is still limited by a sequential portion.

9.

A company is developing a new algorithm to recommend personalized movies and TV shows to users based on their viewing history and preferences. They realize that creating a perfect recommendation algorithm that satisfies every user's preferences is practically impossible due to the vast diversity of tastes and preferences among users. Instead, they decide to implement a heuristic approach that provides satisfactory recommendations for the majority of users in a reasonable amount of time.

Which principle does this decision best demonstrate?

a)

Unreasonable algorithms may sometimes also be undecidable

b)

Heuristics can be used to solve some problems for which no reasonable algorithm exists

c)

Two algorithms that solve the same problem must also have the same efficiency

d)

Approximate solutions are often identical to optimal solutions

10.

A sequential algorithm is broken into three stages

Sequential Algorithm Time

  • Download stage: 1 minute

  • Sorting stage: 6 minutes

  • Upload stage: 1 minute

A parallel version of the algorithm completes the sorting stage in parallel leading to a new set of times

Parallel Algorithm Time

  • Download stage: 1 minute

  • Sorting stage: 2 minutes

  • Upload stage: 1 minute

What is the speedup of the parallel solution?


a)

  6 minutes

b)

4 minutes

c)

2

d)

3

11.


Which of the following are benefits of parallel and distributed computing?

I. Distributed computing improves the speed at which an individual computer executes a program

II. Parallel computing scales more effectively than sequential computing

III. Distributed computing allows larger problems to be solved quicker

a)

I

b)

I and II

c)

II and III

d)

I , II and III

12.

A programmer for a weather website needs to display the proportion of days with freezing temperatures in a given month.

Their algorithm will operate on a list of temperatures for each day in the month. It must keep track of how many temperatures are below or equal to 32. Once it's done processing the list, it must display the ratio of freezing days over total days.

Which of these correctly expresses that algorithm in pseudocode?

a)

b)

c)

d)

13.

The flow chart below visualizes an algorithm to generate the Fibonacci numbers, a famous mathematical sequence.

If the variable max is set to 5, what would be displayed as a result of executing this algorithm?

a)

1 1 2 3 5 8

b)

1 1 2 3 5

c)

1 2 3 5 8

d)

1 2 3 5

14.
How many comparisons would it take to find the value 2 in the following list using a binary search?
[1, 4, 7, 8, 5, 2, 9]
a)
3
b)
2
c)
6
d)
Not possible, list is out of order
15.
How many comparisons would it take to find the value 2 in the following list using a binary search?
[1, 2, 4, 5, 7, 8, 9]
a)
1
b)
2
c)
3
d)
4
16.

Which graph has an efficiency that is considered unreasonable?

a)

green

b)

yellow

c)

orange

d)

red

17.

Which graph is most efficient for a large number of inputs?

a)

green

b)

yellow

c)

orange

d)

red

18.

Why might someone use a heuristic?

a)

some problems cannot be solved in a reasonable amount of time

b)

some problems require multiple devices to solve

c)

some problems are unsolvable

d)

some problems are too difficult to be solved without a computer

19.

Which is true about a binary search?

a)

The data must be sorted in order to use a binary search

b)

It has a polynomial efficiency

c)

It cannot be completed in a reasonable time

d)

It can only be used on a list of numbers

20.

A computer is performing a LINEAR search on the sorted list of 11 numbers below. What is the maximum number of iterations needed to find the item?

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

(a)  

21.

Distributed computing improves the speed at which an individual computer executes a program

a)

True

b)

False

22.

Distributed computing allows larger problems to be solved quicker

a)

True

b)

False

23.

Which statement about parallel computing is true?

a)

Parallel computing takes twice as long as sequential computing.

b)

Parallel computing can only be used when the devices are on different servers.

c)

Parallel computing takes the same time as sequential computing to complete a task.

d)

At some point, adding parallel portions will no longer increase efficiency.

24.

A sequential algorithm takes a total of 15 minutes to complete while a parallel version of the algorithm takes a total of 5 minutes to complete.

What is the speedup of the parallel solution?

a)

1.5

b)

2

c)

3

d)

10

25.

Which graph has a polynomial efficiency?

a)

green

b)

yellow

c)

orange

d)

red

26.

Which graph has a linear efficiency?

a)

green

b)

yellow

c)

orange

d)

red

27.

What is the difference between a decision problem and an optimization problem?

a)

decision problems are solved by just one computer, optimization problems use multiple computers

b)

decision problems have a linear efficiency, optimization problems have an exponential efficiency

c)

decision problems have a yes/no answer, optimization problems cannot be answered

d)

decision problems have a yes/no answer, optimization problems look for the best solution

28.

Which of these algorithms will move the robot along the same path as the algorithm below?

a)

MOVE_FORWARD()

TURN_RIGHT()

MOVE_FORWARD()

TURN_RIGHT()

MOVE_FORWARD()

TURN_RIGHT()

MOVE_FORWARD()

TURN_RIGHT()

b)

REPEAT 2 TIMES

{

    MOVE_FORWARD()

    MOVE_FORWARD()

    TURN_RIGHT()

    MOVE_FORWARD()

    TURN_RIGHT()

}

29.

What is iteration?

a)

completing steps in order

b)

executing a portion of an algorithm based on a given condition

c)

repeating a portion of an algorithm

d)

running a program on multiple devices

30.

The time used to complete a task sequentially divided by the time to complete a task in parallel is called (a)  

31.

A (a)   provides a "good enough" solution when it is impractical or impossible to find an actual solution.

32.

A (a)   search checks each element until the correct value is found.

33.

A (a)   search repeatedly cuts a sorted list in half until a desired element is found.

34.

Instruction that use sequencing, selection, and iteration is called an (a)   .

35.
What is pseudocode?
a)
Simplified programming language, that is not a specific language
b)
Complicated programming language
c)
Simple programming language, which is linked to a specific language
d)
A type of cheese
36.
What is an advantage of a linear search?
a)
It is very quick
b)
It only works with ordered lists
c)
It is a simple algorithm
37.
What is an advantage of a binary search
a)
It's very quick
b)
It only works with ordered lists
c)
It is a simple algorithm
38.
What is the biggest disadvantage of a binary search?
a)
It is slow
b)
It can only be used if the data is sorted into an order
c)
It takes the data and keeps dividing it in half until it finds the item it is looking for
39.
As the data set grows in size, linear search becomes more efficient than binary search. 
a)
True
b)
False
40.
What is the maximum number of comparisons a linear search algorithm could make while searching a 100 item list?
a)
50
b)
51
c)
100
d)
101
41.
Describe a disadvantage of a linear search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
42.
Describe a disadvantage of a binary search algorithm
a)
If the criteria matches the last item in list, entire list has to be checked.
b)
Simple to code than a binary search.
c)
Quicker than a linear search.
d)
More complicated to code than a linear search.
43.

Programs are broken into small pieces, some of which are run simultaneously.

a)

Sequential Computing

b)

Parallel Computing

c)

Distributed Computing

d)

Speedup

44.

The time used to complete a task sequentially divided by the time to complete a task in parallel

a)

Sequential Computing

b)

Parallel Computing

c)

Distributed Computing

d)

Speedup

45.

Programs run in order, one command at a time.

a)

Sequential Computing

b)

Parallel Computing

c)

Distributed Computing

d)

Speedup

46.

A problem for which no algorithm can be constructed that is always capable of providing a correct yes-or-no answer.

a)

Heuristic

b)

Undecidable Problem

c)

Unreasonable Time

d)

Reasonable Time

47.

Algorithms with exponential or factorial efficiencies are examples of algorithms that run in an unreasonable amount of time.

a)

Reasonable Time

b)

Unreasonable Time

48.

Algorithms with a polynomial efficiency or lower (constant, linear, square, cube, etc.) are said to run in a reasonable amount of time.

a)

Reasonable Time

b)

Unreasonable Time

49.

Any algorithm whose efficiency includes an 2n, 3n, 4n … is called ______________.

a)

Problem

b)

Polynomial

c)

Exponential

d)

Efficiency

50.

Any algorithm whose efficiency includes an n2, n3, n4 … is called ___________.

a)

Problem

b)

Polynomial

c)

Pseudocode

d)

Efficiency

51.

A measure of how many steps are needed to complete an algorithm.

a)

Problem

b)

Algorithm

c)

Pseudocode

d)

Efficiency

52.

A general description of a task that can (or cannot) be solved with an algorithm

a)

Problem

b)

Algorithm

c)

Sequencing

d)

Iteration

53.
Can this shape be used for both Start and Stop?
a)
Yes
b)
No
54.
What is the purpose of an arrow in a flowchart?
a)
Shows the relationships between shapes/ the flow of information
b)
They look nice when we use them
c)
We don't use arrows
d)
Shows the way the arrow is directed
55.
What does this shape represent?
a)
Input/Output
b)
Decision
c)
Process
d)
Start/Stop
56.
What symbol do flowcharts begin with?
a)
oval
b)
parallelogram
c)
rectangle
d)
diamond
57.

What should be considered when designing an algorithm?

a)

If there is more than one way of solving the problem

b)

If the correct hardware is being used

c)

If the correct software is being used

58.

What is important to remember when designing an algorithm?

a)

whether to use a flowchart or pseudocode

b)

the instructions are in the correct order

c)

that it must be easy to read

59.

How are symbols connected together in a flowchart?

a)

Symbols do not get connected together in a flowchart

b)

With lines and an arrow to show the direction of flow

c)

By numbers

60.

Which of these is the correct symbol for a process in a flowchart?

a)

A diamond

b)

A rectangle

c)

A parallelogram

61.

What is the symbol for a decision in a flowchart?

a)

A parallelogram

b)

A diamond

c)

A circle

62.

What are the two main ways that algorithms can be designed?

a)

Images or videos

b)

In pseudocode or as a flowchart

c)

By hardware or software

63.

What does sequence mean?

a)

To create a pattern

b)

To do something in order

c)

To do something randomly

d)

To repeat something over and over again

64.

What does selection mean?

a)

Selection is following instructions in order.

b)

Selection is to repeat something over and over again

c)

Selection is when you have a choice of options

d)

Selection is choosing the best option

65.
What would be the output of this flowchart if the student scored 89?
a)
Fail
b)
Pass
c)
Merit
d)
Distinction
66.
Identify a variable within this flowchart.
a)
INPUT
b)
Start
c)
12
d)
RESULT
67.

A group of students writes their names and unique student ID numbers on sheets of paper. The sheets are then randomly placed in a stack.

Their teacher is looking to see if a specific ID number is included in the stack. Which of the following best describes whether their teacher should use a linear or a binary search?

a)

The teacher could use either type of search though the linear search is likely to be faster

b)

The teacher could use either type of search though the binary search is likely to be faster

c)

Neither type of search will work since the data is numeric

d)

Only the linear search will work since the data has not been sorted

68.
a)
b)
c)
d)
69.

a)

These algorithms are equally efficient

b)

Algorithm A is more efficient than algorithm B

c)

Algorithm B is more efficient than algorithm A

d)

The algorithms have different efficiencies depending on the input size

70.

The algorithm shown is used to find the largest element in a list of numbers.

By modifying one of the lines in the program it is possible to make the algorithm find the SMALLEST element. Which line would need to be modified and how?

a)

Line 01 becomes target <- list[2]

b)

Line 04 becomes IF (num < target)

c)

Line 04 becomes IF (num = target)

d)

Line 01 becomes list[0] <- target