This introduction covers Organising Data within Insertion Sort for GCSE Computer Science. Revise Insertion Sort in 3.1 Fundamentals of Algorithms for GCSE Computer Science with 15 exam-style questions and 10 flashcards. This topic appears regularly enough that it should still be part of a steady revision cycle. It is section 2 of 8 in this topic. Use this introduction to connect the idea to the wider topic before moving on to questions and flashcards.
Organising Data
Imagine storing test scores for 30 students. You could create 30 separate variables (score1, score2... score30) - messy! Or use an array - one variable holding all 30 values, accessed by index. Now imagine storing student name, age, and scores together. A record (struct) bundles related data fields together. Arrays are like train carriages (same type, numbered). Records are like forms (different fields, named).
Practice questions for Insertion Sort
Which statement best describes how insertion sort works?
Describe how insertion sort works. Your answer should include how the algorithm processes each element.