Question
Which type of search (linear, binary, or hash) is the best choice for the following scenarios? Explain why you would choose that type of search,
Which type of search (linear, binary, or hash) is the best choice for the following scenarios? Explain why you would choose that type of search, ensuring that you illustrate what characteristics in the scenario limit and/or support the type of search you can perform [2 marks each]. Assume that you cannot rearrange any of the data in any way. Submit your answers as a .pdf file.
a. You need to find the phone number for a specific person on your contacts list, which is organized alphabetically by name.
b. You want to the first item on your shopping list (e.g. a pair of shoes), in a department store that is organized by department (e.g. food, housewares, clothes, electronics, etc).
c. You want to find the longest word in the dictionary.
d. You are looking at a departures list in an airport (which is sorted by the destination city), and you want to find your flight to Ottawa in the list.
e. You have a record of visits to your website, organized by visit time. You want to find when a specific person last visited your website, and are given only the person's name.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started