Question 1
7 marksDid your answer earn the marks?
13 original exam-style questions - 5 pages of questions with a full mark scheme - free printable PDF.
| StudentID | StudentName | TutorGroup | {ModuleCode, ModuleName, Grade} |
|---|---|---|---|
| 1001 | Amara Okafor | 12A | {(COMP101, Computer Systems, A), (COMP102, Programming, B)} |
| 1002 | Liam Fraser | 12B | {(COMP101, Computer Systems, B)} |
| StudentID | StudentName | TutorGroup | ModuleCode | ModuleName | Grade |
|---|---|---|---|---|---|
| 1001 | Amara Okafor | 12A | COMP101 | Computer Systems | A |
| 1001 | Amara Okafor | 12A | COMP102 | Programming | B |
| 1002 | Liam Fraser | 12B | COMP101 | Computer Systems | B |
PROCEDURE SortPackets(packets, n)
FOR i <- 1 TO n - 1
current <- packets[i]
j <- i - 1
WHILE j >= 0 AND packets[j].seqNum > current.seqNum
packets[j + 1] <- packets[j]
j <- j - 1
ENDWHILE
packets[j + 1] <- current
NEXT i
ENDPROCEDUREThis checks your answers in your browser, stores nothing on a server and needs no account.