Algorithms

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
Question 50
Easy

An environmental telemetry system uses the following algorithm to sort water quality readings:

# sensorData has the format [sensorID, location, turbidityValue]

PROCEDURE bubbleSortSensors()
    SET tempRecord TO []
    FOR i FROM 0 TO LENGTH(sensorData) - 1 DO
        FOR j FROM 0 TO LENGTH(sensorData) - 2 DO
            IF sensorData[j, 2] > sensorData[j + 1, 2] THEN
                SET tempRecord TO sensorData[j]
                SET sensorData[j] TO sensorData[j + 1]
                SET sensorData[j + 1] TO tempRecord
            END IF
        END FOR
    END FOR
END PROCEDURE

State the specific type of data structure represented by sensorData in this algorithm.

[1]

Algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Algorithms