Comparisons necessary to accomplish task


Assignment:

A. You are given a list of n names (all of the names are distinct) with instructions to put them in alphabetical order. How many comparisons are necessary to accomplish your task?

B. After you have accomplished the task to part a, you are given another name. How many comparisons are necessary to place this name in its place in the alphabetical list? What is the average or expected number of comparisons?

C. After you have accomplished the task in part a, you are given k more names to put in the list. How many comparisons are necessary? What is the average number of comparisons actually needed?

Provide complete and step by step solution for the question and show calculations and use formulas.

Solution Preview :

Prepared by a verified Expert
Mathematics: Comparisons necessary to accomplish task
Reference No:- TGS01914867

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)