All mind maps topics

Algorithms, bin packing and sortingEdexcel A-Level Further Maths: Mind map

Algorithms
Order

Algorithms

sorting and packing

orderbinssorts
Bin packing
Bubble sort
Quick sort

Exam questions on Algorithms, bin packing and sorting

  1. The following algorithm is applied to two positive integers aa and bb, where a>ba>b. Step 1: input aa and bb. Step 2: let rr be the remainder when aa is divided by bb. Step 3: if r=0r=0, output bb and stop. Step 4: replace aa by bb and replace bb by rr. Step 5: go back to Step 2.
    State what the algorithm finds, and explain why it must eventually stop.2 marks
  2. Nine files of sizes 7, 13, 8, 3, 5, 9, 4, 14 and 12 MB are to be saved on memory cards, each of capacity 20 MB. A file cannot be split between cards.
    Use the first-fit decreasing algorithm to pack the files. State the number of cards used and the contents of each.2 marks
  3. The list 23, 8, 31, 15, 4, 19, 27 is to be sorted into ascending order using quick sort. The pivot is always the middle item of the list or sublist: in position N+12\frac{N+1}{2} if NN is odd and N+22\frac{N+2}{2} if NN is even. Items smaller than the pivot go to its left and larger items to its right, each keeping their original order.
    Show the result of the first pass of quick sort, stating the pivot used.3 marks
See the full worksheet

Written by the Exaim team, led by Shaun Daswani (Head of Upper Secondary, Improve ME Institute; MSc Financial Mathematics, Imperial College London; BSc, UCL) and Jason Daswani (operational lead, Improve ME Institute; LSE).