WDM11Topic 1.13 questions
Flow charts, sorting algorithms, binary search and bin packing.
Specification points for this topic are coming soon.
Get a plain-language explanation, a worked example and the usual mistake.
Sign in to get a plain-language explanation of any specification point.
Original practice questions written in the style of the exam.
Carry out the first pass of a bubble sort to arrange the list below into ascending order.
| 23 | 17 | 31 | 12 | 25 | 9 |
|---|
Write down the list after the first pass, and state the number of comparisons and the number of swaps made.
Eleven boxes, with the heights (in cm) below, are to be stacked in piles of height at most .
| 8 | 7 | 14 | 9 | 6 | 9 | 5 | 15 | 6 | 7 | 8 |
|---|
(a) Calculate a lower bound for the number of piles needed.
(b) Use the first-fit decreasing algorithm to allocate the boxes to piles.
(c) Explain whether your answer to (b) is optimal.