paper 1 exam q Flashcards
Explain one advantage to a structured approach to programming (2 marks)
Structured programs are easier to understand (1) as the program is split into smaller sections
Explain how a merge sort algorithm works (4 marks)
A list is divided into sub-lists at the midpoint until each sub-list is of length 1 (1)
the algorithm compares individual elements as pairs (1)
then the individual items are then merged back together into sub-lists (1)
until one list is produced in the right order (1)
State 3 advantages of using subroutines (3 marks)
subroutines can be developed independently (1)
Subroutines make it easier to discover errors in code (1)
subroutines make program code easier to understand (1)
State why having a clear identifier name is better than a letter (2 marks)
It describes the purpose of the variable (1)
This makes the algorithm easier to understand (1)