AQA D1 2011 January — Question 2

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2011
SessionJanuary
TopicFixed Point Iteration

2 A student is using a quicksort algorithm to rearrange a set of numbers into ascending order. She uses the first number in each list (or sublist) as the pivot. Her correct solution for the first three passes is as follows.
Initial list1074221316195
After 1st pass7451022131619
After 2nd pass4571013161922
After 3rd pass4571013161922
  1. State the pivots used for the 2nd pass.
  2. Write down the number of comparisons on each of the three passes.
  3. Explain whether the student has completed the algorithm.