Searching Algorithm - Which to use for this problem?
The original problem was:
You get a job with a small e-commerce company.
b) The customer base has grown to 8,000,000 customers. Jorge now insists that the sorting algorithm must be as fast as possible in all cases, but the algorithm may now use up to 50,000,000 bytes of additional memory.
Each reference to a customer record takes up 4 bytes. Which of the sorting algorithms (merge sort or quick sort) could you use in this situation? Explain your answer. (**I already chose merge sort, which is correct**)
What I need to know is the answer for (a) and (b) below
One reason Jorge wants to sort the list is to be able to search for a customer record efficiently.
a) In the worst case, how many comparisons will it take to search for a customer record in an unsorted list of 8,000,000 customer records? Explain your answer. Which searching algorithm would you use?
b) After the list has been sorted, how many comparisons will it take to search for a customer record? Explain your answer. Which searching algorithm would you use?