4.
- Sam (S)
- Janelle (J)
- Haoyu (H)
- Alfie (A)
- Cyrus (C)
- Komal (K)
- Polly (P)
- David (D)
- Tom (T)
- Lydia (L)
A binary search is to be performed on the names in the list above to locate the name Lydia.
- Using an appropriate algorithm, rearrange 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.
- Use the binary search algorithm to locate the name Lydia in the list you obtained in (a). You must make your method clear.