Professional Documents
Culture Documents
Task 2:
Do the same Task 1 but this time do not consider cost variable, but use start time and end
time values to see how much time is spend for different size of array and different size of
number.
Task 3:
Making graphs. Plot the values on graph using excel sheet.
Hint: while sorting large array of numbers, you can check your processors performance
from task manager. Take a screen shot if anything unusual.
Program:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.io.FileNotFoundException;
import java.util.Scanner;
System.out.println("Enter filename");
file=input.next();
input.close();
start = System.currentTimeMillis();
sort(num);
end = System.currentTimeMillis();
System.out.print("Sorting TIme"+(end-start)+"ms");
write(num,file);
}
}