D1 June 2010 Q1

EdexcelOld spec8 marksAlgorithms

1.

Hajra
(H)
Vicky
(V)
Leisham
(L)
Alice
(A)
Nicky
(N)
June
(J)
Sharon
(S)
Tom
(T)
Paul
(P)

The table shows the names of nine people.

(a) Use a quick sort to produce the list of names in ascending alphabetical order.
You must make your pivots clear. (4)
(b) Use the binary search algorithm on your list to locate the name Paul. (4)