D1: Algorithms (sorting, searching, bin packing) – Edexcel IAL Decision Mathematics (WDM1)

26 questions · page 1 of 2 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
1
WDM1 D1 · Jun 2026 · Section 1, Question 1May/June 2026D111 marks
Loading question…
Question text

1.
24 16 34 21 38 12 31 5 9 14 23
The eleven numbers above are to be packed into bins of size 60
(a) Calculate a lower bound for the minimum number of bins required.
(2)
(b) Use the first‑fit bin packing algorithm to pack the numbers into bins of size 60
(3)
(c) Use bubble sort to sort the list of numbers into descending order, showing the result
after each pass.
(4)
(d) Use the first‑fit decreasing bin packing algorithm to pack the numbers into bins of
size 60
(2)
(Total for Question 1 is 11 marks)

2
WDM1 D1 · Jun 2026 · Section 1, Question 2May/June 2026D15 marks
Loading question…
Question text

2.
START
INPUT A
A
Let B
10
A
1
Let C
( B )
B
2
Let D = B – C
Is
Yes
OUTPUT C
–0.1 < D < 0.1?
No
STOP
Let B = C
Figure 1
The flowchart for an algorithm is shown above.
The input for the algorithm is a positive number.
(a) Apply the algorithm using A = 1250. You must complete the table in the answer
book, showing the results at each step of the algorithm. Give your values to
3 decimal places where necessary.
(4)
(b) State how the output, C, relates to the input, A
(1)
(Total for Question 2 is 5 marks)

3
WDM1 D1 · Jun 2026 · Section 1, Question 4May/June 2026D110 marks
Loading question…
Question text

4.
A
B
C
D
E
F
G
H
A
–
34
42
29
36
43
28
6x + 7
B
34
–
27
40
28
51
43
8x – 2
C
42
27
–
31
41
37
32
46
D
29
40
31
–
25
34
43
39
E
36
28
41
25
–
30
38
52
F
43
51
37
34
30
–
31
48
G
28
43
32
43
38
31
–
34
H
6x + 7
8x – 2
46
39
52
48
34
–
The table shows the shortest distances, in miles, between eight towns, A, B, C, D, E, F,
G and H, where x is an unknown positive integer.
Raphael wants to visit all eight towns and needs to find a route that minimises the total
distance travelled returning to the starting point.
An initial upper bound for the length of Raphael’s route, obtained using the nearest
neighbour algorithm starting at H, is 256 miles. This nearest neighbour route starts with
arc HG.
(a) Use the nearest neighbour algorithm starting at A, to obtain an expression for a
second upper bound for the length of Raphael’s route. You must state the route and
its length in terms of x.
(3)
Given that the upper bound obtained by starting at A is better than the initial
upper bound,
(b) use the answer to part (a) to calculate the value of x
(3)
(c) By deleting A and all its arcs, obtain a lower bound for the length of
Raphael’s route.
(3)
(d) Write down the smallest interval that must contain the length of Raphael’s route.
(1)
(Total for Question 4 is 10 marks)

Advertisement
4
WDM1 D1 · Jun 2026 · Section 2, Question 2May/June 2026D15 marks
Loading question…
Question text

2.
You may not need to use all the rows in this table.
Is
–0.1 < D < 0.1
A
B
C
D
?
Question 2 continued
Is
–0.1 < D < 0.1
A
B
C
D
?
Output
(Total for Question 2 is 5 marks)

5
WDM1 D1 A · Jun 2026 · Question 3May/June 2026D1 A5 marks
Loading question…
Question text

3.
28 12 15 24 20 13 16
7 11
The nine numbers above are to be packed into bins of size n, where n is an
unknown integer.
When the first‑fit bin packing algorithm is used, the numbers are packed as follows
Bin 1
28
12
7
Bin 2
15
24
11
Bin 3
20
13
16
(a) Determine the possible values of n
(3)
When the first‑fit decreasing bin packing algorithm is used, four bins are required.
(b) Determine the value of n, justifying your answer.
(2)
(Total for Question 3 is 5 marks)

6
WDM1 D1 · Jan 2026 · Section 1, Question 1January 2026D15 marks
Loading question…
Question text

1. In the following list, eleven sports are identified by their initial letter
(V) Volleyball
(H) Handball
(W) Wheelchair basketball
(B) Baseball
(R) Rugby
(G) Golf
(C) Cricket
(P) Paratriathlon
(T) Tennis
(D) Diving
(S) Squash
(a) Explain why a binary search cannot be performed on this list in its current form.
(1)
(b) Write the list in an appropriate form and show how a binary search is used to try to
locate (F) Football. You must make your choice of pivots clear.
(4)
(Total for Question 1 is 5 marks)

7
WDM1 D1 · Jan 2026 · Section 1, Question 4January 2026D17 marks
Loading question…
Question text

4. The following list of eleven distinct integers is to be sorted into ascending order.
44
35
73
24
58
32
21
61
54
31
x
The first two passes of bubble sort are
35
44
24
58
32
21
61
54
31
73
x
35
44
24
32
21
58
54
31
61
73
x
(a) Explain why x must satisfy the inequality 45  x  57
(2)
(b) Carry out one more pass of bubble sort, showing the result at the end of the pass.
(2)
Given that
•
when the numbers are placed in bins of size 120, the lower bound for the number of
bins required is five
•
when the first‑fit decreasing algorithm is used to place the numbers in bins of size
160, x is placed in the second bin, which also contains 54
(c) determine the value of x. You must make your reasoning clear.
(3)
(Total for Question 4 is 7 marks)

8
WDM1 D1 · Jan 2026 · Section 1, Question 6January 2026D110 marks
Loading question…
Question text

6.
A
B
C
D
E
F
G
H
A
‑
24
19
28
25
32
29
31
B
24
‑
22
31
25
23
37
41
C
19
22
‑
18
21
41
31
35
D
28
31
18
‑
24
21
27
26
E
25
25
21
24
‑
17
31
25
F
32
23
41
21
17
‑
26
31
G
29
37
31
27
31
26
‑
24
H
31
41
35
26
25
31
24
‑
The table shows the least distances, in km, between eight towns. Imani wants to visit all
eight towns. She needs to find a route which minimises the distance travelled, starting
and finishing at A.
(a) Show that there are two nearest neighbour routes starting at A. You must make your
method clear and state the routes and their lengths.
(4)
(b) State, giving a reason, which route from part (a) gives the better upper bound for the
length of Imani’s route.
(1)
(c) By deleting A and all of its arcs, use Prim’s algorithm, starting at B, to obtain a
lower bound for the length of Imani’s route. You must show your working.
(4)
A second lower bound of 172 km is obtained by deleting H.
(d) Write down the smallest interval that must contain the optimal length for
Imani’s route.
(1)
(Total for Question 6 is 10 marks)

Advertisement
9
WDM1 D1 A · Jan 2026 · Question 1January 2026D1 A11 marks
Loading question…
Question text

1.
5.0 1.8 6.2 2.8 3.0 4.0 3.8 2.4 0.6 0.8 7.8
The numbers in the list are the lengths, in feet, of eleven pieces of wood. They are to be
cut from planks of wood of length 10 feet. You should ignore wastage due to cutting.
(a) Calculate a lower bound for the number of planks needed. You must make your
method clear.
(2)
(b) Use the first-fit bin packing algorithm to determine how these pieces could be cut
from 10 feet planks.
(3)
(c) Carry out a quick sort to produce a list of the lengths in descending order. You
should show the result of each pass and identify your pivots clearly.
(4)
(d) Use the first-fit decreasing bin packing algorithm to determine how these pieces
could be cut from 10 feet planks.
(2)
(Total for Question 1 is 11 marks)

10
WDM1 D1 · Jun 2025 · Section 1, Question 1May/June 2025D14 marks
Loading question…
Question text

1: The list of numbers shown below represents the masses, in kg, of nine items that are to
be moved from one factory to another.
180
300
250
410
240
120
230
310
190
The items will all be moved, by van, at the same time.
Each van can carry at most 600 kg.
(a) Calculate a lower bound for the number of vans required.
(2)
(b) Use the first‑fit bin‑packing algorithm to allocate the items to vans.
(2)
(Total for Question 1 is 4 marks)

11
WDM1 D1 · Jun 2025 · Section 1, Question 3May/June 2025D19 marks
Loading question…
Question text

3:
(i) A list of twelve numbers is to be sorted into ascending order.
28 18 50 27 48 8 25 12 56 31 33 42
(a) Use a quick sort to obtain the sorted list. You should show the result of each pass
and identify your pivots clearly.
(4)
(b) Show how the binary search algorithm is used to try to locate the number 40 in
the list. You must clearly indicate your choice of pivots and which part of the list
you are rejecting.
(3)
(ii) A different list of nine distinct integers is to be sorted into descending order.
23
20
32
15
8
19
6
22
x
The list is sorted using bubble sort. The first three passes are
23
20
32
15
19
8
22
6
x
23
32
20
19
15
22
8
6
x
32
23
20
19
22
15
8
6
x
Determine the range of possible values of x
(2)
(Total for Question 3 is 9 marks)

12
WDM1 D1 · Jan 2025 · Section 1, Question 1January 2025D19 marks
Loading question…
Question text

1. The following list of eleven numbers is to be packed into bins of size 55
26
19
31
10
14
30
33
18
3
28
5
(a) Use the first‑fit bin packing algorithm to pack the numbers into bins of size 55
(3)
(b) Use quick sort to sort the list into descending order, showing the result after each
pass. You must clearly identify the pivots used.
(4)
(c) Apply the first‑fit decreasing bin packing algorithm to pack the numbers into bins
of size 55
(2)
(Total for Question 1 is 9 marks)

13
WDM1 D1 · Jan 2025 · Section 1, Question 3January 2025D15 marks
Loading question…
Question text

3.
Start
Input a, b
Let c = ab
a
Let d = a
b
Let e = INT(d)
Let f = be
Let g = a – f
Yes
c
Is
Let h = c
g = 0?
b
No
Output h
Let a = b
Stop
Let b = g
Figure 2
Figure 2 shows the flowchart for an algorithm.
The input for the algorithm is two positive integers.
The function INT(X) is the largest integer less than or equal to X
(a) Complete the table in the answer book, with a = 1980 and b = 462, showing the
results at each step of the algorithm.
(4)
(b) Explain how the output, h, relates to the inputs, a and b
(1)
(Total for Question 3 is 5 marks)

Advertisement
14
WDM1 D1 · Jan 2025 · Section 2, Question 3January 2025D15 marks
Loading question…
Question text

3. You may not need all the rows in this table.
a
b
c
d
e
f
g
h
Output
(Total for Question 3 is 5 marks)

15
WDM1 D1 · Jun 2024 · Section 1, Question 1May/June 2024D114 marks
Loading question…
Question text

1.
5.2
4.7
6.5
4.5
3.1
5.1
1.8
2.9
3.4
3.8
1.2
(a) Use the first‑fit bin packing algorithm to determine how the eleven numbers listed
above can be packed into bins of size 14
(3)
(b) The list of numbers is to be sorted into ascending order. Use a quick sort to
obtain the sorted list. You should show the result of each pass and identify your
pivots clearly.
(4)
(c) Apply the first‑fit decreasing bin packing algorithm to the sorted list to pack the
numbers into bins of size 14
(3)
(d) Explain why the number of bins used in part (c) is optimal.
(1)
(e) Use the binary search algorithm to try to locate 3.0 in the list of numbers.
Clearly indicate how you choose your pivots and which part of the list is rejected at
each stage.
(3)
(Total for Question 1 is 14 marks)

Advertisement