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.:- M92786434
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Business Management

Phase 1 discover and assessstep 1 identify discomforts in

"Phase 1: Discover and Assess Step 1: Identify discomforts in the community (or organization). Step 2: Find out what has been done. Step 3: Invite others into the assessment process. Phase 2: Focus and Commit Step 4: Ana ...

Suppose that third national bank has reserves of 20000 and

Suppose that Third National Bank has reserves of $20,000 and check able deposits of $200,000. The reserve ratio is 10 percent. The bank sells $20,000 in securities to the Federal Reserve Bank in its district, receiving a ...

How can i determine what the root cause of the problem is

How can I determine what the root cause of the problem is with the computer's performance? I know that one Idea is to do updates to the operating system. One of those fixes may resolve the problem.

Name a company that addressed a recent ethical problem in a

Name a company that addressed a recent ethical problem in a positive way. Also, explain how or if this positively affects us as a community?

Indifference curve and budget lineannie has an income of

Indifference Curve and Budget Line Annie has an income of $180 an hour. Popcorn costs $6 a bag, and costs $4 a six-pack cola a.  Draw a graph of Annie's budget line with six-pack of  cola on the x-axis , and popcorn on t ...

What are the benefits of deciding to have a centrally

What are the benefits of deciding to have a centrally located facility instead of several smaller facilities? and who are the once involved in this decision? How technology can be involved in providing an optimal decisio ...

A manufacturer of bed linens made from 100 percent

A manufacturer of bed linens made from 100 percent all-natural fabrics wants to know if the addition of a line of mixed-blend linens would attract current nonusers to its products and cause them to become users. What sho ...

Do you think there is some type of diversity we really

Do you think there is some type of diversity we really aren't interested in? Or, perhaps what we really are looking for is an end to discrimination, but at some point in the last 10-15 years that has morphed into the con ...

Truefalse questions no explanation is neededa on a

True/False Questions (NO explanation is needed): (a) On a Windows-based laptop computer the SECURITY registry file maintains a list of the host computer's wireless connections. (b) IEEE 802.11 Security Standard WEP (Wire ...

There are many channels of communication within the

There are many channels of communication within the workplace. How would you determine which channel(s) to use to disseminate all of the various types of information that need to be communicated within any given day at y ...

  • 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