Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write a program in C++ to test the performance of quick select algorithm (L12 slide 7-9) under different group size setting. In the slides, to find the pivot, the algorithm divide all elements into group of 5, find the median of each group and use the median of medians from all group as pivot. In our assignment 4 we studied the analysis of using group of 3 and group of 7. Now you are writing a program to count the operations in all these setting (even more, your program can take any setting of group size that is greater than 2 and less than n)

Input to the program:

1. Size of each group in pivot selection (at least 3, at most n)

2. Number of elements in the sequence

3. k (kth number looking for in the selection problem)

The program needs to randomly generate integer values as elements in the sequence, run the algorithm, count the number of operations and output following

1. kth element''s value

2. number of operations performed

Use the program to collect the performance of group size = 3, 5, 7 under different input size and plot them in one chart. Explain the chart in a report.

Turn in your report and program source code.

Due date: Dec. 2nd Friday midnight

Hint: 1. Start with Random Select, (textbook 9.2 and 7.3)

2. modify it to group of 5 version quick select, (textbook 9.3)

3. modify group of 5 to group of 3,

4. modify to group of 7,

5. collect the data and prepare the report,

6. modify the code to accept any group size

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92053868
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Computer Engineering

A sample of 36 us households is taken and the average

A sample of 36 U.S. households is taken and the average amount of newspaper garbage or recycling is found to be 27.8 pounds with a standard deviation of 2 pounds. Estimate, with 99% confidence, the mean amount of newspap ...

I am studying java for the first time and i am using a

I am studying java for the first time and I am using a program called Eclipse to build my programs. I am working with arrays and I am tasked with the following: Create a method that restores an image in which each pixel ...

Question suppose you are designing a database for a library

Question : Suppose you are designing a database for a library, the library system contains information about people who borrow. Each person is uniquely identified. People can search and borrow books. A book has book ID. ...

Mary kate is a project manager in the it department for a

Mary Kate is a project manager in the IT department for a university. She has been asked to manage a project to create faculty intranet. The university has multiple campuses in various locations, and professors and other ...

Question what steps should be taken to detect alleged

Question : What steps should be taken to detect alleged industrial/cyberespionage? Discuss the implications of each of the steps proposed.

Suppose we evaluate the performance of a player based on

Suppose we evaluate the performance of a player based on the player's HR and RBI score. Assume each HR counts as 3 points while each RBI counts as 2 points. Find the playerIDs who have the highest score. -Select a random ...

What are some skills individuals who work in the field of

What are some skills individuals who work in the field of cyber security need to prevent hacks in to a company's computers?

Suppose pointers are 4 bytes long and keys are 12 bytes

Suppose pointers are 4 bytes long, and keys are 12 bytes long. How many keys and pointers will a block of 16,384 bytes have?

Question research different information systems management

Question : Research different information systems management disaster response plans of major organizations that have had to respond to fairly recent disasters. Discuss the results of the organization's recovery efforts.

Scheme number computera write a recursive procedure digits

Scheme number computer a. Write a recursive procedure (digits n) that computes the number of digits in the integer n using a recursive process. For example, (digits 42) should return 2 and (digits 13579) should return 5. ...

  • 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