Question: Need help completing the attached programs in C# The purpose of the project is to perform a timing experiment. You are required to complete the
Need help completing the attached programs in C#
The purpose of the project is to perform a timing experiment. You are required to complete the following activities:
Write a computer program that prompts the user for a number, creates an array for that number of random integers, and then usees 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 Do Not use an API from the language library. Write the program to perform the sort.
Repeat but use selection sort this time. Again, write out the program for the selection sort. DO not use the language library.
and are primarily intended to make sure that your algorithms work.
Once you are convinced your programs work, do the following
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 different 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 runningtime to
Create a for loop that iterates times.
In the body of the loop,
Create an array of n random integers
Get the time and set this to starttime notice the sort is started after each array is built. You want to time the srt process only 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 endtime Subtract starttime from endtime and add the result to totaltime
Once the program has run, note
The number of items sorted
The average running time for each array totaltime
Repeat the process using and as the size of the array.
Repeat using selection sort.
You now have data points the averages from the three array sizes for the two sort algorithms Create a spreadsheet showing the results of and and create a graph to
graphically represent the information. Show both sort algorithms on the same graph for comparison. eg
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
