D1 June 2011 Q1

EdexcelOld spec9 marksAlgorithms

1.

1.Jenny
2.Merry
3.Charles
4.Ben
5.Toby
6.Hyo
7.Kim
8.Richard
9.Greg
10.Freya

A binary search is to be performed on the names in the list above to locate the name Kim.

(a) Explain why a binary search cannot be performed with the list in its present form. (1)
(b) Using an appropriate algorithm, alter the list so that a binary search can be performed, showing the state of the list after each complete iteration. State the name of the algorithm you have used. (4)
(c) Use the binary search algorithm to locate the name Kim in the list you obtained in (b). You must make your method clear. (4)