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 otherwise i will not grade your work

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.:- M93123220

Have any Question?


Related Questions in Computer Engineering

20 of students take finite math 30 take history and 5 take

20% of students take Finite Math, 30% take History, and 5% take both Finite Math and History. If a single student is chosen at random, find the probability that the randomly selected student is taking Finite Math given t ...

A sample of a compound is decomposed in the laboratory and

A sample of a compound is decomposed in the laboratory and produces 330 g carbon, 69.5 g hydrogen, and 220.2 g oxygen. Calculate the empirical formula of the compound. Express your answer as an empirical formula.

Question we are running the insertion sort algorithm on the

Question : We are running the Insertion Sort algorithm on the array A = . a) Write the array A at the start of the iteration j=5 of the for loop. b) What is the value of i at the start of the iteration j=6 of the for loo ...

Question the subnet mask for a class c network is

Question : The subnet mask for a class C network is 255.255.255.248. How many subnetworks are available? How many assignable hosts ids per subnet? The response must be typed, single spaced, must be in times new roman fon ...

Question suppose you are in the process of drawing the dfds

Question : Suppose you are in the process of drawing the DFDs, and you have found that one of your Level 1 DFD describing a process in level 0, has more than 8 sub-processes. What does that indicate? And How do you fix i ...

Briefly explain what separations are how do they effect the

Briefly explain what separations are, how do they effect the average duration of unemployment?

Please discuss the design principles that guide the authors

Please discuss the design principles that guide the authors of instruction sets in making the right balance. Provide examples of application of each of the three design principles while designing instruction sets.

Define risk and explain why this concept is important to

Define risk and explain why this concept is important to small business managers.

Suppose i am designing a personnel database for a

Suppose I am designing a personnel database for a university. The university has three types of personnel: students, staff, and faculty. Here are the characteristics of the three groups: -All three groups have a name and ...

Suppose there are three decks of cards on the table a

Suppose there are three decks of cards on the table, a number is written on each card. And each deck is sorted in decreasing order (The maximum value is on the deck in top). The goal is to find the minimum value between ...

  • 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