Describe the process used by a binary search algorithm, and explain why binary search would not be appropriate for the list [3,2,5,7,9]

A binary search starts at the middle of the list and compares this item with the search term, if the item matches the search term, then the search is complete.If the item is not the search term, it is compared with the search term and the list is split in half either above the middle item (if the item is lower than the search term) or below the middle item (if the item is greater than the search term)The search then repeats with this new list until the data item is found, or the list size is 1, and the item is not the search term, at which point the search concludes that the search term is not present in the list.The list given would not be appropriate as binary search only works for ordered lists.

Answered by William H. Computing tutor

1081 Views

See similar Computing GCSE tutors

Related Computing GCSE answers

All answers ▸

Convert 01010001 from binary to decimal


What is a Mutatable Data Structure?


What is two's complement, and how do I calculate it?


How do you convert a number from denary to hexadecimal?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy
Cookie Preferences