Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Management Expert

1. How many comparisons and interchanges (in terms of file size n) are performed by Simple insertion sort for the following files:

i) A sorted file

ii) A file that is sorted in reverse order (that is, from largest to smallest)

iii) A file in which x[0], x[2], x[4]... are the smallest elements in sorted order, and in which x[1], x[3], x[5]... are the largest elements in sorted order, e.g. [ 3  14  5  15  9  18  11 19 ].

2. How many comparisons and interchanges (in terms of file size n) are performed by Shell Sort using increments 2 and 1 for the following files:

i) A sorted file

ii) A file that is sorted in reverse order (that is, from largest to smallest)

iii) A file in which x[0], x[2], x[4]... are the smallest elements in sorted order, and in which x[1], x[3], x[5]... are the largest elements in sorted order, e.g. [ 3  14  5  15  9  18  11 19 ].

3. Determine which of the following sorts is most efficient. Consider if the data is small and simple or larger and more complex.

a) simple insertion sort

b) straight selection sort

c) bubble sort

4. Determine the number of comparisons (as a function of n and m) that are performed in merging two ordered files a and b of sizes n and m, respectively, by the merge method presented in the lecture, on each of the following sets of ordered files:

a. m=n and a[i] < b[i] < a[i+1], e.g. a=[ 6, 9, 12, 15, 29, 37] and b = [8, 10, 14, 25, 33, 45]

b. m=n and a[n] < b[1], e.g. a =[ 2, 5, 9] and b = [12, 14, 16]

a[i] refers the value in position i of file a, etc.

5. Determine the number of comparisons (as a function of n and m) that are performed in merging two ordered files a and b of sizes n and m, respectively, by the merge method presented in the lecture, on each of the following sets of ordered files:

a. m=n and a[n/2] < b[1] < b[m] < a[(n/2)+1], 

e.g.  a = [2, 5, 7, 55, 61, 72] and b =[9, 15, 17, 21, 29, 46]

b. m=1 and b[1] < a[1]

c. m=1 and a[n] < b[1]

a[i] refers the value in position i of file a, etc.

For questions 6 - 9, compare the efficiency of using sequential search on an ordered table of size n and an unordered table of the same size for the key key:

6. If no record with the key key is present

7. If one record with the key key is present and only one is sought.

8. If more than one record with the key key is present and it is desired to find only the first

9. If more than one record with the key key is present and it is desired to find them all.

Business Management, Management Studies

  • Category:- Business Management
  • Reference No.:- M92789399
  • Price:- $45

Priced at Now at $45, Verified Solution

Have any Question?


Related Questions in Business Management

Given a string of length n a subsequence is any non empty

Given a string of length n, a subsequence is any non empty subset of characters read from left to right. For example, if A = atc then a, t, c, at, tc, ac, atc are all subsequnces of A. Given two strings of length n, m, d ...

What is the purpose of each of the following financial

What is the purpose of each of the following financial statements: income statement, balance sheet, statement of cash flow and statement of owner's equity?

Model this situation using a game tablehawk and dovenbsptwo

Model this situation using a game table. Hawk and Dove:   Two animals are fighting over some prey. Each can be passive or aggressive. Each prefers to be aggressive if the other is passive, and passive if the other is agg ...

Total quality management involves a continuous improvement

Total quality management involves a continuous improvement approach. 1. How is continuous improvement related to innovation? 2. What is breakthrough innovation? 3. What are the risks and rewards associated with innovatio ...

Suppose a consumer is trying to make a choice over the

Suppose a consumer is trying to make a choice over the consumption of two goods: x and y. Px = 3, Py = 4 and the income is equal to 50. Assume that the government distributes some stamps that are good to buy 5 units of g ...

Why does out of date stock need to be disposed of what

Why does out of date stock need to be disposed of? What records need to be kept when disposing of out of date stock? Where should these records be stored?

Michael porter says that the essence of strategy is

Michael Porter says that" the essence of strategy is choosing what not to do." Using a company of your choice, illustrate Porter's statement.

What would be examples of valid selection methods used by

What would be examples of valid selection methods used by the human resource department to ensure selecting the appropriate candidate for a job.

Financialoperational dataclinic monthly average based on

Financial/operational data Clinic Monthly average based on 6-month performance FTE Licensed 4 Visits 320 Procedures 650 Net Revenue $20800 Salary (all staff) $25217 Total expenses (including salaries) $32320 Questions: 1 ...

What are some examples of marketing activities that are

What are some examples of "marketing" activities that are associated with the Summer Olympics? How does global marketing and the use of new digital marketing techniques facilitate marketing activities at the Olympics in ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As