Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Sorting Program Note: Make sure you use c++ programming

For this assignment, you are to write a comparative algorithm that will compare the efficiency of three sorting routines. Here is the approach you should use:

1. Write a Bubble Sort function with a test program.

2. Write a Shell Sort function with a test program.

3. Write a Quick Sort function (using stacks, rather than recursion) with a test program.

4. Write the main program (that will include the other 3 programs).

Notes:

In the test programs, the logic should be as follows:
Print the random numbers
Sort the numbers keeping track of the costs
Print the sorted numbers
Print the cost

Use __INCLUDE_LEVEL__ in all of the programs, which includes the sorting routines and a test program. ( Sample program using include level)

The main program should have the following logic.

Generate 20 random numbers.
Print the random numbers.

Move the original random numbers into another array.
Bubble Sort the other array.
Print the sorted numbers AND the cost of sorting the numbers.

Move the original random numbers into another array.
Shell Sort the other array.
Print the sorted numbers AND the cost of sorting the numbers.

Move the original random numbers into another array.
Quick Sort the other array.
Print the sorted numbers AND the cost of sorting the numbers.

To compute the cost, you assign values to every swap and every compare. A compare costs 1 unit, and a swap costs 6 units.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93123375

Have any Question?


Related Questions in Computer Engineering

42 of the cars in a dealer lot are red 21 are black and 10

42% of the cars in a dealer lot are red, 21% are black and 10% are white. The remainder are some other unspecified color. Salespersons randomly shows three cars to three different customers. What is the probability the f ...

Sometimes when we visit super markets we may share our

Sometimes when we visit super markets, we may share our personal details to get (for example) "Loyalty cards" and other benefits. Do you think sharing such details is a good approach? Give arguments for both cases: "shar ...

Computer sciencewhat is required of an organization to

Computer Science What is required of an organization, to implement and maintain IT Governance? What outside resources are available to assist technology managers in the implementation and maintenance process?

Scheduling algorithms are again becoming more important as

Scheduling algorithms are again becoming more important as we look at operating system that run on mobile devices. Are their scheduling algorithms different from those found on traditional interactive system? Compare and ...

System analysis and design1 explain the difference between

System Analysis and Design 1) Explain the difference between too much feedback and too little feedback and provide a scenario for each one (two scenarios are needed - one for a lot of feedback and one for too much) and w ...

Consider the following reactionccl4g 4 cl2g rarr ch4g 4

Consider the following reaction: CCl4(g) + 4 Cl2(g) → CH4(g) + 4 HCl(g) What mass of CCl4 is formed by the reaction of 2.00 g of methane with an excess of chlorine?

Suppose a coworker approaches you and asks what an ethical

Suppose a coworker approaches you and asks what an ethical hacker does. She does not understand the role that an ethical hacker plays in the security industry and assumes that such a hacker intentionally causes damage. E ...

Question what are the subnets that can be supported with

Question : What are the subnets that can be supported with this prefix 204.15.5.0/27. How many hosts can be supported by each of these subnets? Please typewrite your answers, no handwritten answers please.

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Which sentence would work better as a thesis statement for

Which sentence would work better as a thesis statement for a three-to-five-page college paper? Remember that a thesis should be a central idea that requires supporting evidence; it should be of adequate scope for essay's ...

  • 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