Skip to content

Course home

Data structures

Data structures

EasyMedium
1234567891011121314151617181920212223
Question 12

A telemetry logging program uses a record structure of type TelemetryNode to store performance characteristics of server nodes in a network cluster. Inspect the pseudo-code below:

RECORD TelemetryNode
    nodeID : String
    uptimeDays : Integer
    latencyMs : Real
    isActive : Boolean
ENDRECORD

nodeA ← TelemetryNode('Server-A', 142, 12.4, True)
nodeB ← TelemetryNode('Server-B', 89, 415.8, True)
nodeC ← TelemetryNode('Server-C', 305, 8.1, True)
networkCluster ← [nodeA, nodeB, nodeC]
maxLatency ← 0.0
targetIndex ← 0

FOR i ← 0 TO 2
    IF networkCluster[i].latencyMs > maxLatency THEN
        maxLatency ← networkCluster[i].latencyMs
        targetIndex ← i
    ENDIF
ENDFOR

OUTPUT networkCluster[targetIndex].nodeID, ' has the highest latency'

Write a pseudo-code statement that updates the nodeB record to show that the node is no longer active.

[1]
Markscheme

Data structures Questions

  1. GCSE
  2. /Computer Science
  3. /Data structures

36 exam-style questions on AQA GCSE Computer Science Data structures. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank