Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

PROJECT ASSIGNMENT

The purpose of the project is to perform a timing experiment. You are required to complete the following activities:

1. Write a computer program that prompts the user for a number, creates an array for that number of random integers, and then use the bubble sort to order the array. The program should print out the array prior to the call to the sorting algorithm and afterwards. You can write the program in either Java, C++, C#, or whatever language you are most comfortable in.

2. Repeat 1 but use selection sort this time.

1 and 2 are primarily intended to make sure that your algorithms work.

Once you are convinced your programs work, do the following

1. Write a computer program that prompts the user for one number, n for the number of items in the array to sort, and create and sort 1000 arrays of this size timing the run to get an average time to sort an array of this size. Then do the following:

Initiate a variable running_time to 0
Create a for loop that iterates 1000 times.
In the body of the loop,
Create an array of n random integers

Get the time and set this to start-time. You will have to figure out what the appropriate command is in the programming language you are using to find the time (Important: Do not start the timer until after the array is created).

Use bubble sort to sort the array

Get the time and set this to end-time Subtract start-time from end-time and add the result to total_time

Once the program has run, note

The number of items sorted

The average running time for each array (total_time/1000)

Repeat the process six times, using 500, 2500 and 5000 as the size of the array for each of the two algorithms.

2. Repeat 3 using selection sort.

3. Create a spreadsheet showing the results of 3 and 4 and create a graph to graphically represent the information. Show both sort algorithms on the same graph for comparison.

4. Write a one page document explaining the results, bearing in mind that both algorithms have a complexity of O(n^2) and what you know about complexity analysis. Use your knowledge of complexity analysis to explain your results.

Submit

1. Program code for 1
2. Program code for 2
3. Program code used in 3 and the results of the nine program runs
4. Program code used in 4 and the results of the nine program runs
5. The spreadsheet created in 5
6. The report. In the report, say which machine you ran the experiments on (type of processor, RAM, etc).

Use the associated drop box. You can submit all of this in a single file, or in separate files. If you have any questions, post them on the discussion forum.

Computer Engineering, Engineering

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

Have any Question?


Related Questions in Computer Engineering

Question having a strong statistical picture of data is

Question : Having a strong statistical picture of data is important to being able to properly identify trends in statistical analysis. In R, how can an analyst identify appropriate sample distributions and test for norma ...

Fully explain at least one reason why many developing

Fully explain at least one reason why many developing countries suffered serious debt crisis in the early 1980s. Does this reason you explained in debt support Krueger & Srinivasan's argument? Why or why not? How could t ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question consider a problem that you think can be addressed

Question: Consider a problem that you think can be addressed using AI/ML. Provide a detailed 1200-1500 words report that explains the problem and solution. And then explains the challenges associated with adoption of tha ...

Question suppose users share a 2 mbps link also suppose

Question : Suppose users share a 2 Mbps link. Also suppose each user transmits continuously at 1 Mbps when transmitting, but each user transmits only 20 percent of the time. When a circuit switching is used, how many use ...

Question 1 war driving is a wireless attack describe at

Question: 1. War driving is a wireless attack. Describe at least four war driving tools and the purpose of each. Your response should be at least 150 words in length. 2. Name and describe the four major access control mo ...

C programminghelp with a program positivec that include the

***C PROGRAMMING*** Help with a program positive.c that include the following function: void extract(int *a, int n, int *positive, int *size); The function should use pointer arithmetic, not subscripting. The extract fun ...

Question steve jobs was a strong charismatic leader who

Question: Steve Jobs was a strong, charismatic leader who co-founded Apple and is credited with much of the success of the company. Some believe that Tim Cook, who became CEO in 2011, embraces a more collaborative leader ...

Suppose circle is a class derived from the class point now

Suppose, Circle is a class derived from the class Point. Now consider the following statements: Point p[] = new Point[12]; P[0] = new Circle(); Now suppose Circle has a method Area() computing are of a circle, and Point ...

The requirements analysis phase is an essential part of a

The requirements analysis phase is an essential part of a system development methodology. According to the FAST methodology, which stake-holders typically participate in this phase? What is the primary focus of requireme ...

  • 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