Create a graph to graphically represent the information

Assignment Help Computer Engineering
Reference no: EM131894319

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.

Reference no: EM131894319

Questions Cloud

Show budgeted income statement for the month ended december : All other out-of-pocket expenses are paid for in cash. Show budgeted income statement for the month ended December for Addams Company
What does tony do in the given situation : Tony, a data analyst for a major casino, is working after normal business hours to finish an important project. He realizes that he is missing data.
The break-even ratio and the internal rate of return : The internal rate of return. The break-even ratio.
Creating a strategy that promotes a consistent message : Today's sports marketers use social media as a means for creating competitive advantage for themselves within the sports business landscape.
Create a graph to graphically represent the information : Create a spreadsheet showing the results of 3 and 4 and create a graph to graphically represent the information.
How many shares of lansing stock is jennifer deemed to own : Each of the three shareholders holds 100 shares in company. Under the §318 stock attribution rules, how many shares of Lansing stock is Jennifer deemed to own
Compute the future worth in year list under salvage value : Compute the future worth in year list under salvage value and equiv. annual worth of your cash flow.
Find the normal time for each element : A time study was conducted on a job that contains four elements. The observed times and performance ratings for six cycles are shown in the following table.
Separation between mythos and logos : 1. How might one think differently if we do not assume a separation between mythos and logos - myth and reason?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Discuss the immediate update recovery technique

Discuss the immediate update recovery technique in both single-user and multiuser environments. What are the advantages and disadvantages of immediate update?

  Assign commands toward handling databases

Construct a vector x that contains integers, real numbers, chains of characters, and several NA missing values. Test for the positions of the missing values using the is.na function. Produce the subvector where all missing values have been elimina..

  Find minimal expansion of boolean functions

Use K-maps to find a minimal expansion as a Boolean sum of Boolean products of Boolean functions that have as input the binary code for each decimal digit.

  Why computer system problem in an instructional lab

make an input form that could be used to record information about a computer system problem in an instructional lab or a training facility. Include spaces on the form to record information

  Taskproceed according to the following

taskproceed according to the following instructions.1.identify a recent within the last six 6 months moral dilemma or

  Redesign the memory cell of given figure

Redesign the memory cell of Figure to make it suitable for coincident decoding (i.e., two enable signals).

  Create a program that asks the user for the number of month

Create a program that asks the user for the number of a month, then creates the array F of (n+1) Fibonacci numbers, and prints the sequence.

  Describe how the theta join operation can be extended

Describe how the theta join operation can be extended so that tuples from the left, right, or both relations are not lost from the result of a theta join.

  Write a program that plays a simple trivia game

Write a program that plays a simple trivia game. The game should have five questions. Each question has a corresponding answer and point value between 1 and 3 based on the difficult of the question.

  Congress lacks the necessary time and expertise to produce

congress lacks the necessary time and expertise to produce legislation for every area of conduct in society. this is

  Define an ada constant that gives the name pi to the value

Define an Ada constant that gives the name Pi to the value 3.14159. Declare an integer variable called Count, a float variable called Sum, and string variable.

  Developing ways to support every applications

List some of the ways which we may guarantee that the majority of our target audience may play our applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd