wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

OCR H446 - 2.3 Algorithms - Algorithms and Programming 02

Total questions: 85

Worksheet time: 46mins

Name
Class
Date
1.

Which of the following graphs shows Constant Big-O notation?

a)

b)

c)

d)

e)

2.

Which of the following graphs shows Linear Big-O notation?

a)

b)

c)

d)

e)

3.

Which of the following graphs shows Polynomial Big-O notation?

a)

b)

c)

d)

e)

4.

Which of the following graphs shows Exponential Big-O notation?

a)

b)

c)

d)

e)

5.

Which of the following graphs shows Logarithmic Big-O notation?

a)

b)

c)

d)

e)

6.

Which of the following best describes a Constant Big-O notation?

a)

This means that the Size of the data set does not impact the Time complexity remains the same.

b)

This means that Size of the data set increases so does the Time Complexity at the same rate.

c)

This means that as the Size of the data set increases the algorithm takes much more time to run.

d)

This means as algorithm takes increasingly more Time to run as the data set increases.

e)

This means the data set takes a decreasing amount of Time more to complete as the data set increases,

7.

Which of the following best describes a Linear Big-O notation?

a)

This means that the Size of the data set does not impact the Time complexity remains the same.

b)

This means that Size of the data set increases so does the Time Complexity at the same rate.

c)

This means that as the Size of the data set increases the algorithm takes much more time to run.

d)

This means as algorithm takes increasingly more Time to run as the data set increases.

e)

This means the data set takes a decreasing amount of Time more to complete as the data set increases,

8.

Which of the following best describes a Polynomial Big-O notation?

a)

This means that the Size of the data set does not impact the Time complexity remains the same.

b)

This means that Size of the data set increases so does the Time Complexity at the same rate.

c)

This means that as the Size of the data set increases the algorithm takes much more time to run.

d)

This means as algorithm takes increasingly more Time to run as the data set increases.

e)

This means the data set takes a decreasing amount of Time more to complete as the data set increases,

9.

Which of the following best describes a Exponential Big-O notation?

a)

This means that the Size of the data set does not impact the Time complexity remains the same.

b)

This means that Size of the data set increases so does the Time Complexity at the same rate.

c)

This means that as the Size of the data set increases the algorithm takes much more time to run.

d)

This means as algorithm takes increasingly more Time to run as the data set increases.

e)

This means the data set takes a decreasing amount of Time more to complete as the data set increases,

10.

Which of the following best describes a Logarithmic Big-O notation?

a)

This means that the Size of the data set does not impact the Time complexity remains the same.

b)

This means that Size of the data set increases so does the Time Complexity at the same rate.

c)

This means that as the Size of the data set increases the algorithm takes much more time to run.

d)

This means as algorithm takes increasingly more Time to run as the data set increases.

e)

This means the data set takes a decreasing amount of Time more to complete as the data set increases,

11.

Which Big-O notation is show with the equation below:

O(1)

a)

Constant

b)

Linear

c)

Polynomial

d)

Exponential

e)

Logarithmic

12.

Which Big-O notation is show with the equation below:

O(n)

a)

Constant

b)

Linear

c)

Polynomial

d)

Exponential

e)

Logarithmic

13.

Which Big-O notation is show with the equation below:

O(n^2)

a)

Constant

b)

Linear

c)

Polynomial

d)

Exponential

e)

Logarithmic

14.

Which Big-O notation is show with the equation below:

O(2^n)

a)

Constant

b)

Linear

c)

Polynomial

d)

Exponential

e)

Logarithmic

15.

Which Big-O notation is show with the equation below:

O(log(n))

a)

Constant

b)

Linear

c)

Polynomial

d)

Exponential

e)

Logarithmic

16.

Which complexity is described below:

How long an algorithm will take to run for a given data set of size n.

a)

Time Complexity

b)

Space Complexity

17.

Which complexity is described below:

How much memory is required to run an algorithm for a given data set of size n

a)

Time Complexity

b)

Space Complexity

18.

Which searching algorithms is described below:

It only works if records in the file are in order. It involves accessing the middle record in the file and determining if the target record has been found or, if not. Then logically removing data based on higher or lower values.

a)

Linear Search

b)

Binary Search

19.

Which searching algorithms is described below:

Works even if the data is not in order. It involves accessing each piece of data one after each other deciding if it has been found or not.

a)

Linear Search

b)

Binary Search

20.

Which searching algorithm is shown in the image?

a)

Linear Search

b)

Binary Search

21.

Which searching algorithm is shown in the image?

a)

Linear Search

b)

Binary Search

22.

Which algorithm is outlined below:

1)Look at the first item in the unordered list.

2)If this is the item you are looking for, then stop the search, it has been found.

3)If not, then look at the next item in the list.

4)Repeat steps 2) – 3) until you find the item you are looking for or you’ve checked every item.

a)

Linear Search

b)

Binary Search

23.

Which algorithm is outlined below:

1)Find the middle item in the ordered list ((n+1) ÷ 2).

2)If this is the item you’re looking for, then stop the search, you’ve found it.

3) If not compare the item you are looking for to the middle item. If it comes before the middle item, get rid of the second half of the list. If it comes after the middle item, get rid of the first half of the list.

4) You will be left with a list smaller than the original. Repeat steps 1) – 3) on the smaller list until you find the item you are looking for.

a)

Linear Search

b)

Binary Search

24.

Which algorithm is shown in the code in the image?

a)

Linear Search

b)

Binary Search

25.

Which algorithm is shown in the code in the image?

a)

Linear Search

b)

Binary Search

26.

Which of the following best describe Linear Search:

a)

Very simple algorithm to code.

b)

Best suited to small lists.

c)

Not very efficient as it has to search every item individually

d)

Can only be used on ordered lists.

e)

This is more suitable to larger lists.

27.

Which of the following best describe Binary Search:

a)

Very simple algorithm to code.

b)

Best suited to small lists.

c)

Efficient, in general takes less steps

d)

Can only be used on ordered lists.

e)

This is more suitable to larger lists.

28.

Which algorithm is outlined below:

A simple algorithm popular with inexperienced programmers. It is inefficient when sorting large amounts of data as the time taken is related to the square of the number of items. Takes each item in pairs and compares them.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

29.

Which algorithm is outlined below:

A simple sorting algorithm that builds the final sorted array (or list) one item at time. It is much less efficient on large lists than more advanced algorithms.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

30.

Which algorithm is outlined below:

A type of divide and conquer algorithm which sorts the given sequence in place meaning that it doesn’t require extra storage as would be needed in a merge sort. The basic idea is dividing the sequence into two sub-lists around an element which is called the pivot.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

31.

Which algorithm is outlined below:

A type of divide and conquer algorithm that was incited by John von Neumann. First the list is divided into the smallest unit (1 element), then each element is compared with the adjacent list to sort and merge the two adjacent lists.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

32.

Which sorting algorithm is shown in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

33.

Which sorting algorithm is shown in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

34.

Which sorting algorithm is shown in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

35.

Which sorting algorithm is shown in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

36.


Which
algorithm is shown in the code in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

37.


Which
algorithm is shown in the code in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

38.


Which
algorithm is shown in the code in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

39.


Which
algorithm is shown in the code in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

40.


Which
algorithm is described below:

1) Look at the first two items in the list.

2) If they are in the right order, leave them as they are. If they are in the wrong order, swap them round.

3) Move on to the next pair of numbers and repeat step 2).

4) Repeat step 3) until you get to the end of the list. Each time you go through all of the cards is called a pass.

5) Repeat steps 1) – 4) until you get a full pass without any swaps.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

41.


Which
algorithm is described below:

1) Look at the second item in a list.

2) Compare it to all the items before it and insert it into the right place.

3) Repeat step 2) for all items that are sorted. When all the items have been compared the list is sorted.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

42.


Which
algorithm is described below:

1) Split the list in half.

2) Repeat step 1) on all sub-lists contain only one item.

3) Merge pairs of sub-lists, Each time pairs merge sort them into the correct order.

4) Repeat step 3) until all sub-lists have been merged together.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

43.


Which
algorithm is described below:

1) Set a pointer to the first and last item in the list.

2) While the first pointer is not equal to the second pointer (list of 1) then

2a) If the items at the pointers are in the wrong order, swap the items and the pointers.

2b) Move the first pointer one item towards the second pointer.

3) Repeat from step 1 on the list of items to the left of the pointer.

4) Repeat from step 1 on the list of items from the pointer

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

44.

Which of the following are the advantages of an Bubble sort?

a)

A simple algorithm, that can easily be used.

b)

Can efficiently check if a list is already in order.

c)

Does not use much computer memory.

d)

Consistent runtime regardless of how unorganised the list is.

e)

Intuitive way to sort data whilst being easily coded.

45.

Which of the following are the advantages of an Insertion sort?

a)

Copes very well with small lists. Often paired with merge sorts to highlight each's advantages.

b)

Requires very little memory to run.

c)

Very quick to add new items into an already sorted list.

d)

Consistent runtime regardless of how unorganised the list is.

e)

Intuitive way to sort data whilst being easily coded.

46.

Which of the following are the advantages of an Merge sort?

a)

Much more efficient than Bubble and insertion sorts on large lists.

b)

Requires very little memory to run.

c)

Very quick to add new items into an already sorted list.

d)

Consistent runtime regardless of how unorganised the list is.

e)

Intuitive way to sort data whilst being easily coded.

47.

Which of the following are the advantages of a Quick sort?

a)

Useful for sorting arrays fast

b)

Does not take up a lot of storage space.

c)

Very quick to add new items into an already sorted list.

d)

Consistent runtime regardless of how unorganised the list is.

e)

Intuitive way to sort data whilst being easily coded.

48.

What path finding algorithm is shown in the image?

a)

Dijkstra's Algorithm

b)

A* Algorithm

49.

Which of the Path Finding algorithm is being described below?

Finds the shortest path in a graph by checking each node one at a time following the shortest path.

a)

Dijkstra's Algorithm

b)

A* Algorithm

50.

Which of the Path Finding algorithm is being described below?

Finds the shortest path in a graph by using heuristics to estimate the shortest path to follow.

a)

Dijkstra's Algorithm

b)

A* Algorithm

51.

Which Path Finding Algorithm is described by the algorithm below:

Mark the start node as a distance of 0 from itself and all other nodes as an infinite distance from the start node.

While the destination node is unvisited

Go to the closest unvisited node to A (initially this will be A itself) and call this the current node.

For every unvisited node connected to current node:

Calculate distance to current plus the distance of the edge unvisited.

If this distance is less than the currently recorded shortest distance, make it the new shortest distance.

Next connected node

End While

a)

Dijkstra's Algorithm

b)

A* Algorithm

52.

Which Path Finding Algorithm is described by the algorithm below:

Begin at the start node and make this current node.

While the destination node is unvisited

For each open node directly connected to the current node

Add to the list of open nodes.

Add the distance from start to the heuristic estimate of distance left.

Assign this value to the node.

Next connected node

Make the unvisited node with the lowest value the current node.

End While

a)

Dijkstra's Algorithm

b)

A* Algorithm

53.

Which Path Finding algorithm is this code for?

a)

Dijkstra's Algorithm

b)

A* Algorithm

54.

Which Path Finding algorithm is this code for?

a)

Dijkstra's Algorithm

b)

A* Algorithm

55.

What part of the graph is highlighted?

a)

Node

b)

Edge

c)

Weight

d)

Heuristic

56.

What part of the graph is highlighted?

a)

Node

b)

Edge

c)

Weight

d)

Heuristic

57.

What part of the graph is highlighted?

a)

Node

b)

Edge

c)

Weight

d)

Heuristic

58.

What part of the graph is highlighted?

a)

Node

b)

Edge

c)

Weight

d)

Heuristic

59.

Which of the following best describes a "Heuristic"?

a)

A value given to an edge on a graph.

b)

A point on a graph with an ID, that is connected to others by edges.

c)

A line that connects nodes.

d)

A value that is an estimated distance remaining from the destination node.

60.

Which Data Structure is described below:

A list of values that is ordered and unchangeable.

a)

Tuple

b)

List

c)

Array

d)

Stack

e)

Queue

61.

Which Data Structure is described below:

A list of values that can be ordered and can change.

a)

Tuple

b)

List

c)

Array

d)

Stack

e)

Queue

62.

Which Data Structure is described below:

A list of values that are arrange as either 1D, 2D or 3D.

a)

Tuple

b)

List

c)

Array

d)

Stack

e)

Queue

63.

Which Data Structure is described below:

Values stored in a LIFO order.

a)

Tuple

b)

List

c)

Array

d)

Stack

e)

Queue

64.

Which Data Structure is described below:

Values stored in a FIFO order.

a)

Tuple

b)

List

c)

Array

d)

Stack

e)

Queue

65.

Which of the following are functions specific to a Stack?

a)

pop()

b)

push()

c)

peek()

d)

dequeue()

e)

enqueue()

66.

Which of the following are functions specific to a Queue?

a)

pop()

b)

push()

c)

peek()

d)

dequeue()

e)

enqueue()

67.

Which data structure is in the image?

a)

Stack

b)

Queue

c)

Linked List

68.

Which data structure is in the image?

a)

Stack

b)

Queue

c)

Linked List

69.

Which data structure is in the image?

a)

Stack

b)

Queue

c)

Linked List

70.

The beginning of a Linked List is called ?

a)

Head

b)

Null

c)

Pointer

d)

Node

71.

The end of a Linked List is called ?

a)

Head

b)

Null

c)

Pointer

d)

Node

72.

The location of the next node in a Linked List is called ?

a)

Head

b)

Null

c)

Pointer

d)

Node

73.

Each part of a linked list is called?

a)

Head

b)

Null

c)

Pointer

d)

Node

74.

The type of graph shown in the image is?

a)

Undirected

b)

Directed

75.

The type of graph shown in the image is?

a)

Undirected

b)

Directed

76.

Which part of a Tree is described below:

The start node for the tree.

a)

Root

b)

Branch

c)

Leaf

d)

Height

77.

Which part of a Tree is described below:

The path from the root to the end point.

a)

Root

b)

Branch

c)

Leaf

d)

Height

78.

Which part of a Tree is described below:

The end point of a Tree.

a)

Root

b)

Branch

c)

Leaf

d)

Height

79.

Which part of a Tree is described below:

The Value of all the branches from the Root node to the Leaf furthest away.

a)

Root

b)

Branch

c)

Leaf

d)

Height

80.

On the Binary tree in the image what is highlighted?

a)

Root

b)

Parent

c)

Left Child

d)

Right Child

81.

On the Binary tree in the image what is highlighted?

a)

Root

b)

Parent

c)

Left Child

d)

Right Child

82.

On the Binary tree in the image what is highlighted?

a)

Root

b)

Parent

c)

Left Child

d)

Right Child

83.

On the Binary tree in the image what is highlighted?

a)

Root

b)

Parent

c)

Left Child

d)

Right Child

84.

Which Tree Traversal method is shown in the image?

a)

Post-Order (Depth First)

b)

Breadth First

85.

Which Tree Traversal method is shown in the image?

a)

Post-Order (Depth First)

b)

Breadth First