5
3 (a) Draw one line to connect each Operating System (OS) term to the most appropriate
description about it.
OS term Description
Using secondary storage to simulate
additional main memory
Multi-tasking
Managing the processes running on
the CPU
Paging
Managing the execution of many programs
that appear to run at the same time
Interrupt handling
Locating non-contiguous blocks of data and
relocating them
Scheduling
Transferring control to another routine when
a service is required
Virtual memory
Reading/writing same-size blocks of data
from/to secondary storage when required
[5]
(b) Explain how an interpreter executes a program without producing a complete translated
version of it.
...................................................................................................................................................
The interpreter executes each statement line by line. If an error is found in a statement, the execution
is stopped and a report is sent to the user, otherwise the statement is executed. Interpretation is
...................................................................................................................................................
repeated for every loop. An interpreter is required when every time the program is run.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
© UCLES 2021 9618/31/M/J/21 [Turn over
6
4 (a) (i) Explain why Reverse Polish Notation (RPN) is used to carry out the evaluation of
expressions.
...........................................................................................................................................
RPN is a method to represent mathematical expressions. The expression is read from left to
right and the brackets are not required.
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Identify, with reasons, a data structure that could be used to evaluate an expression
in RPN.
Stack is an appropriate data structure to calculate RPN expressions. It is because the numbers
...........................................................................................................................................
are popped out in the reverse sequence compared to the sequence they are input
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(b) Write the infix expression in RPN.
(a – b) * (a + c) / 7
...................................................................................................................................................
ab-ac+*7/
............................................................................................................................................. [1]
(c) Write the RPN expression as an infix expression.
a b / 4 * a b + -
a / b * 4 - (a + b)
...................................................................................................................................................
............................................................................................................................................. [1]
(d) Evaluate the RPN expression:
a b + c d / /
where a = 17, b = 3, c = 48 and d = 12.
Show your working.
(a + b) / (c / d)
...................................................................................................................................................
(17 + 3) / (48 / 12) = 20 / 4 = 5
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
© UCLES 2021 9618/31/M/J/21
7
5 (a) Calculate the shortest distance between the base and each of the other towns in the diagram
using Dijkstra’s algorithm.
Show your working and write your answers in the table provided.
Base
4
5
Town 1 2
1 Town 2
8
Town 3
7 3 Town 6
1
5
6
Town 4 Town 5
Base 1 2 3 4 5 6
Working .....................................................................................................................................
0 I I I I I I
...................................................................................................................................................
4 5 2
...................................................................................................................................................
3 3
...................................................................................................................................................
10
9 8
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answers
Town 1 Town 2 Town 3 Town 4 Town 5 Town 6
3 5 2 9 3 8
[5]
© UCLES 2021 9618/31/M/J/21 [Turn over
8
(b) Explain the use of graphs to aid Artificial Intelligence (AI).
Artificial Neural Networks can be represented using graphs. The graphs can illustrate the relations,
...................................................................................................................................................
weights, and biases between the nodes. Graphs can be analyzed by algorithms such as Dijksta's
...................................................................................................................................................
algorithm
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
6 Give two benefits and two drawbacks of packet switching.
Paths are available for other users
Benefit 1 ...........................................................................................................................................
..........................................................................................................................................................
Better security because the packets are sent along different routes
Benefit 2 ...........................................................................................................................................
..........................................................................................................................................................
Drawback 1 ......................................................................................................................................
Time delay for reassemble the packets
..........................................................................................................................................................
Unsuitable for real time transmission applications
Drawback 2 ......................................................................................................................................
..........................................................................................................................................................
[4]
© UCLES 2021 9618/31/M/J/21