Question
A newspaper route has recently been computerized. Information about each of the 100 customers is stored in an array with individual records containing first name,
A newspaper route has recently been computerized. Information about each of the 100 customers is stored in an array with individual records containing first name, last name, and payment due. When writing a computer program to process the customer records, the programmer is uncertain whether to add a procedure to sort the records. He then decides that he needs the answer to the following questions. Express your answer using values based on the fact that the list size is 100.
(a) If the records are not sorted, what searching mechanism would he have to use and what is the maximum possible number of comparisons that must be made to obtain a particular customer's record? (b) If the records are sorted, what searching algorithm would be best to use and what is the maximum possible number of comparisons that must be made to obtain a particular customers record?
(c) If the records are not sorted, what is the maximum number of operations (comparisons) that would have to be made if he uses Selection Sort to sort the records? (d) If the records are not sorted, what is the maximum number of operations (comparisons) that would have to be made if the uses Merge Sort to sort the records?
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