AQA D1 2016 June — Question 2 4 marks

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2016
SessionJune
Marks4
TopicSorting Algorithms

2
  1. Use a shuttle sort to rearrange into alphabetical order the following list of names:
    Rob, Eve, Meg, lan, Xavi
    Show the list at the end of each pass.
  2. A list of ten numbers is sorted into ascending order, using a shuttle sort.
    1. How many passes are needed?
    2. Give the maximum number of comparisons needed in the sixth pass.
    3. Given that the list is initially in descending order, find the total number of swaps needed.
      [0pt] [4 marks]