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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started