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

885 Views

See similar Computing GCSE tutors

Related Computing GCSE answers

All answers ▸

How do you convert a number from denary to hexadecimal?


Describe two different functions performed by an operating system [4 marks]


Computers use virtual memory, can you explain what this is and how it is used?


What is the difference between data verification and data validation?


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