wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AQA Data Structures and algorithms

Total questions: 78

Worksheet time: 45mins

Name
Class
Date
1.

What is meant by 'declaring' an array?

a)

Create an array in a program, specifying its name and size

b)

creating a program, specifying its size

c)

create a program, specifying its name

d)

create an array to assign to a Selection process

2.
Which value does the command 'list[3]' find?
a)
The fourth value of 'List'
b)
The third value of 'List'
c)
The second value of 'List'
d)
The fifth value of 'List'
3.

scores = [5,7,0,10,8,3,7,3]


Which value will be found using the following statement:


print(scores[2])

a)

5

b)

7

c)

0

d)

10

4.

What is the name given to a number that corresponds to the location of an item of data in an array?

a)

Initial

b)

Primary

c)

Index

d)

Identifier

5.

Arrays have a fixed number of items.


True or False

a)

True

b)

False

6.

Arrays can have different data types?


True or False?

a)

True

b)

False

7.

Which type of array is the following example?


score = [5,7,0,10,8,3,7,3]

a)

1D

b)

2D

c)

3D

d)

4D

8.

How may index numbers are used in accessing a 2D array?

a)

1

b)

2

c)

3

d)

4

9.

What is the name given to an abstract representation of how data is stored in a 2D array?

a)

Record

b)

File

c)

Field

d)

Table

10.

What is the position of the name 'Paula' in the following list:

names = ["Paul","Pranav","Paula","Prea"]

a)

0

b)

1

c)

2

d)

3

11.

In the following list, which item has the index number 3?

["John", "Harry", "Jesse", "John", "Jairus", "Hamza"]

a)

"Jairus"

b)

"Harry"

c)

"Jesse"

d)

"John"

12.

What is the number held in the root node?

(a)  

13.

does not have any more nodes below

(a)  

14.
 In computing, What is FILO?
a)
First In First Out
b)
First In Last out
c)
Last Out Lowest Order
d)
A very thin unleavened dough used for making pastries such as baklava and börek in Middle Eastern and Balkan cuisines.
15.
Which of these data structures is FIFO
a)
Stack
b)
Queue
c)
Binary Tree
d)
Double linked list
16.
In this tree, where would the new value "7" be placed?
a)
On the left "leaf" of "4"
b)
On the right "leaf" of "6"
c)
On the left "leaf" of "15"
d)
Over the top of the current number "5"
17.
What would a dynamic data structure entail?
a)
Memory is allocated to the data structure as the program executes.
b)
Memory is allocated to the data structure at compile time.
c)
The size of the structure is fixed
d)
The data structure can also double as TNT
18.
A strength of Linear searches is that they can be performed without sorting the list before hand... 
a)
True
b)
False
19.
A Binary search requires the data it is searching to be ordered in some way...
a)
True
b)
False
20.

Queues implement which mechanism?

a)

LIFO

b)

FIFO

c)

FILO

d)

LILO

21.

A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Front" pointer point?

a)

0

b)

1

c)

2

d)

3

22.

A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Rear" pointer point?

a)

0

b)

1

c)

2

d)

3

23.

A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Front" pointer point if a deQueue operation is performed.

a)

Bert

b)

Cynthia

c)

Cedric

d)

Albert

24.

What is an advantage of a circular queue?

a)

Free space can be reused

b)

Easy to program

c)

Gives preference to important items

d)

It is static

25.

What is a data structure where the first item added is the first item removed?

a)

Queue

b)

Stack

c)

Char

d)

Integer

e)

Boolean

26.

What is a method of storing data where the amount of data stored (and memory used to store it) will vary as the program is being run?

a)

Static data structure

b)

Dynamic data structure

c)

Heap

d)

Encapsulation

27.

What is a portion of memory from which space is automatically allocated or de-allocated as required?

a)

Static data structure

b)

Dynamic data structure

c)

Heap

d)

Encapsulation

28.

What is a variation of a FIFO structure where some data may leave out a sequence where it has a higher priority than other data items?

a)

Linear queue

b)

Circular queue

c)

Priority queue

d)

Heap

29.

If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?

a)

ABCD

b)

DCBA

c)

ABDC

d)

DCAB

30.

A circular queue is implemented using an array of size 10. The array index starts with 0, front is 6, and rear is 9. The insertion of next element takes place at the array index.

a)

7

b)

0

c)

9

d)

insertion not possible

31.

What is a stack?

a)

A data structure that adds the last added data item.

b)

A data structure that increases data items first.

c)

Data structure that removes the last added data item first

d)

A data structure that multiplies data items

32.

What two operations do stacks require?

a)

Push

b)

Draw

c)

Stretch

d)

Drag

e)

Pop

33.

If you have a stack containing 'A' 'D' 'G' . What will happen if you push 'C' into the stack?

a)

'C' Will be added on top of the stack

b)

'C' Will be added from the bottom of the stack

c)

'C' Will be removed from the stack

d)

'C' Will not be added to the stack

34.

A stack containing 'Dog' 'Cat' & 'Rat' . What will happen if you carry out a pop operation on the stack ?

a)

Noting

b)

Cat will be removed

c)

Dog will be removed

d)

Rat will be removed

35.

If you carry out a pop operation on this stack what will you be left with?

a)
b)
c)
36.

What will happen if you carry out a push operation with the word 'Bill'?

a)
b)
c)
37.

What are Stacks Used For?

a)

Type in data from keyboard

b)

To remove data

c)

To stack information

d)

To keep track of a sequence of operations

38.

A common example of a queue operation is...

a)

Write queue

b)

Do queue

c)

Print queue

d)

Cyber queue

39.

Which of the following is not a style of graph traversal in computing?

a)

Breadth-First

b)

Depth-First

c)

Height-First

40.

Graph traversal is used to find the ______ route to visit all nodes in a network

a)

Shortest

b)

Best

c)

Longest

d)

Most secure

41.

Which method of graph traversal makes use of a stack?

a)

Depth-First

b)

Breadth-First

42.

Which method of graph traversal makes use of a queue?

a)

Depth-First

b)

Breadth-First

43.

Which method of graph traversal continues to visit the first neighbour of each node before backtracking and beginning the next route?

a)

Depth-First

b)

Breadth-First

44.

Which method of graph traversal visits all neighbours of one node before moving on to further nodes?

a)

Depth-First

b)

Breadth-First

45.

Which order of traversal is correct using depth-first?

a)

A B C G D E F

b)

A B D C E C G

46.

Which of the following beginnings to a graph traversal would not be correct for depth-first?

a)

A B C G

b)

A D F

c)

A E D F

d)

A B D C

47.

Which order of traversal is correct using breadth-first?

a)

A B D E C F G

b)

A B C G D E F

48.

Which of the following beginnings to a graph traversal would not be correct for breadth-first?

a)

A B D E

b)

A E D B

c)

A D B E

d)

A D F B

49.

Does Breadth-first search use a queue or a stack?

a)

Stack

b)

Queue

c)

Both

d)

neither

50.

Which of these tree traversal methods is used to output the contents of a binary tree in ascending order?

a)

Pre-Order

b)

In-Order

c)

Post-Order

d)

Monastic Orders

51.

A list must be in order for a Binary search to take place

a)

True

b)

False

52.
displays data items in a hierarchical view
a)
Flowchart
b)
Trees
c)
Binary Tree
d)
Binary Expression Tree
53.
A tree is composed of ____ connected by edges or lines.
a)
Fruit 
b)
Leaf Node
c)
Root Node
d)
Nodes
54.
A Kind of tree where every node in a tree can have at most two children.
a)
Binary Tree
b)
Binary Expression Tree
c)
Tree
d)
Binary Search Tree
55.

The ____ of a Binary Search Tree starts by visiting the current node, then its left child node and then its right child node.

a)

Pre-Order Traversal

b)

In-Order Traversal

c)

Post-Order Traversal

d)

Linear Order Traversal

56.

What is the following expression an example of?


3 + 4

a)

Infix expression

b)

Postfix expression

c)

Afterfix expression

d)

Between expression

57.

What is the following expression an example of?


3 4 +

a)

Infix expression

b)

Postfix expression

c)

Afterfix expression

d)

Between expression

58.

What is the postfix equivalent of the following infix expression?


5 + 6

a)

+ 5 6

b)

5 6 +

c)

6 + 5

d)

6 + 5 +

59.

What is the postfix equivalent of the following infix expression?


5 + 6

a)

+ 5 6

b)

5 6 +

c)

6 + 5

d)

6 + 5 +

60.

What is the infix equivalent for the following postfix expression?


3 5 6 + *

a)

5 + 6 * 3

b)

5 + (3 * 6)

c)

(5 + 6) * 3

d)

5 (+ 6 * 3)

61.

What data structure can be used with postfix expressions?

a)

Queue

b)

Hash Table

c)

Vector

d)

Stack

62.

Which of the following data structures is a LIFO data structure?

a)

hash table

b)

queue

c)

stack

d)

tree

63.

Which of the the following properties would mean that a graph is not a tree?

a)

unweighted

b)

undirected

c)

cyclical

d)

acyclical

64.

What is a characteristic feature of a hash algorithm?

a)

It increases the size of the original file

b)

It's encryption cannot be decrypted

c)

It can easily be reversed

d)

It makes files unreadable

65.

What is a major requirement of a hash algorithm?

a)

It must be fast

b)

It must be colorful

c)

It must be reversible

d)

It must be infinite

66.

What does the term 'hash collision' refer to?

a)

A hash losing its data

b)

A hash algorithm failing

c)

Two different files having the same hash

d)

Two hashes running into each other

67.

What is the significance of a unique hash value?

a)

It ensures data can be easily decrypted

b)

It prevents unauthorized access to the data

c)

It signifies that the data has not been altered

d)

It makes the hash function reversible

68.

What would be a consequence of a hash collision?

a)

Increased security of the hash algorithm

b)

Decreased time to compute the hash

c)

Potential compromise of data integrity

d)

Improved efficiency of data retrieval

69.

What is a hashing function used for?

a)

To calculate the position of an item in a hash table

b)

To determine the size of a hash table

c)

To compare items in a data set

d)

To implement a dictionary data structure

70.

What is rehashing in a hash table?

a)

Finding an alternative position for items in the hash table

b)

Using a two-dimensional hash table

c)

Storing items in a linked list

d)

Searching sequentially in an overflow table

71.

What is chaining in a hash table?

a)

Storing items in a linked list

b)

Using a two-dimensional hash table

c)

Searching sequentially in an overflow table

d)

Finding an alternative position for items in the hash table

72.

Hashing gives each item

a)

A sequential address

b)

A logarithmic address

c)

No address

d)

A unique address

73.

address = key MOD(numberOfSlots)


If key = 5432 and numberOfSlots = 1000

address = ?

a)

5

b)

432

c)

543

d)

5432

74.

What is the status after adding 10

a)
b)
c)
d)
75.

What is the status after adding 7

a)
b)
c)
d)
76.

Which word means storing data in sequence, next to each other?

a)

Contiguous

b)

Contrary

c)

Quantitative

d)

Non-adjacent

77.

What are you aiming to avoid when creating a suitable method for dealing with collisions in a hash table?

a)

Clustering

b)

Merging

c)

Cluttering

78.

Address <----- key MOD(numberOfSlots)

IF KEY = 5432 and numberOfSlots = 100

Address = ?

a)

5

b)

4

c)

32

d)

5432