Question: 1 Sorting Create 3 text files, one with the 50000 integers 1 through 50000 in order, one with the 50000 integers 1 through 50000 in

1 Sorting Create 3 text files, one with the 50000 integers 1 through 50000 in order, one with the 50000 integers 1 through 50000 in reverse order, and one with 50000 random integers (between 1 and 50000). Write a program to

Read the name of a file

Store the contents of the file into a 50000 element array,

Sort the array using an Insertion Sort, and

Print the actual running time (without any server overhead) of the sort.

Print the number of comparisons used in the sort.

Print just the first 30 values in the resulting array

Turn in a printed copy of the program, along with a printout of the output from three separate runs (using the three text files).

2 Big_OH Notation Consider the following functions:

n+sin(n) 4n2 log3n 3n 20n 2 log2n n2/3

(a) Arrange the six expressions by asymptotic growth rate from slowest to fastest.

(b) Graph the following six functions on a single plot varying n from 1 to 10.

n+sin(n) 4n2 log3n 3n 2 n2/3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!