- Parent Category: Programming Assignments' Solutions
We Helped With This JAVA Programming Assignment: Have A Similar One?
|More Info||Java Programming Assignment Help|
Short Assignment Requirements
You are tasked with writing a Java program that will carry out empirical analysis. The program will compare the performance of 4 sorting algorithms. The algorithms should be tested against sorted, unsorted and inversely sorted data, they should also be tested against data sets of 1000, 10,000 and 100,000 elements. A report should be produced (maximum of 1500 words) which will incorporate a series of graphical illustrations (eg: bar charts etc.) that will showcase discrepancies between algorithms when sorting similar data. Please ensure that the environment of the machine is also clearly articulated. All diagrams must be explained and conclusions drawn.
Create a GUI or menu based application that will:
a) Allow the user to select the number of elements the array will hold (1000, 10,000 and 100,000) the program will then generate an array of that length with random numbers between 0 and the size of the array.
b) Allow the user to select which Algorithm (Standard Bubble Sort, Enhanced Bubble Sort, Selection Sort or Insertion Sort) to use to sort that array, time it, along with the number of comparisons and swap operations the algorithm takes, store these details to compare against executions of other algorithms in your report.
c) Allow the user to select a random, sorted or inversely sorted list to run against any of the algorithms again, timing this and storing the time to compare against other algorithms doing the same.
a) See Quadratic Algorithms lecture for notes on creating a timer using the System.currentTimeMillis() method – use the nanosecond version.
b) Use the random number generator in java to populate your array, see below:
a. myArray[i] = (int)(Math.random() * 10)
The CA is not about creating a GUI, no marks will be awarded for this so do not waste too much time on it a menu based system will suffice if you cannot create a GUI.
You should use appropriate classes for the application, structuring you code accordingly, marks will be awarded for this aspect of the CA.
You need to clearly articulate your understanding of each of the sorting algorithms, describing the ‘flaws’ inherent in each when run against certain data oriented in a certain format (sorted, unsorted, inversely sorted).
You should be able to back up your findings with ‘stats’ to show the number of swaps and comparisons (read and write operations) in each of the algorithm executions.