Reference no: EM13699421
Question: In an accident, the Ohio phonebook has gotten mixed up. The names are now really out of order.
You and your enthusiastic, but naive, assistant Carl must fix the trouble. No one can use the phonebook while you are sorting it, so every extra second of sorting time will cost the city billions in economic damage.
Carl has implemented two programs, P1 and P2. Both will do the job correctly.
You must decide which one will be faster.
Part A: Carl picks 20 random names and finds that P1 sorts them faster than P2. "We're using P1!" exclaims Carl. Why are you hesitant to commit?
Part B: Trying to please you, Carl is now sorting 10,000 names with each program. (a) If P1 is still faster on this larger set, will you then agree it will be faster on the whole million-name phonebook? (b) What if P2 is now faster - does that mean P2 is the best choice for the whole phone book? Explain.
Part C: Your computer explodes and Carl puts together a new one from spare parts. The new computer is much faster at arithmetic, but is slower at reading and writing to the disk. Might this affect which program you should use? Discuss.
Part D: In deciding which program to use, is it safer to run lots of tests or read the source code? Or should you do both?
Describe: Note: Carl's code is clear and well-commented - Prepare this application in java programming