Setting up modules for student
This commit is contained in:
@@ -1,9 +1,15 @@
|
|||||||
package Sorting;
|
package Sorting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class contains the main method and presents an interface for the user to
|
||||||
|
* compare sorting algorithm efficiencies. The user will be able to generate files
|
||||||
|
* of random numbers, and to select a set of algorithms to test on a file of random
|
||||||
|
* numbers.
|
||||||
|
*/
|
||||||
public class AlgorithmTester{
|
public class AlgorithmTester{
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
//This is where you will run the program to test your sorting algorithms.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
5
Sorting/InsertionSorter.java
Normal file
5
Sorting/InsertionSorter.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package Sorting;
|
||||||
|
|
||||||
|
public class InsertionSorter extends sorter{
|
||||||
|
|
||||||
|
}
|
||||||
10
Sorting/RandomNumberFileMaker.java
Normal file
10
Sorting/RandomNumberFileMaker.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package Sorting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class will allow the user to make a file of random integers.
|
||||||
|
* The user will be able to select a file name, how many numbers are in the file,
|
||||||
|
* the minimum value generated, and the maximum value generated.
|
||||||
|
*/
|
||||||
|
public class RandomNumberFileMaker {
|
||||||
|
|
||||||
|
}
|
||||||
5
Sorting/SelectionSorter.java
Normal file
5
Sorting/SelectionSorter.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package Sorting;
|
||||||
|
|
||||||
|
public class SelectionSorter extends Sorter {
|
||||||
|
//a class to sort an array of numbers using selection sort
|
||||||
|
}
|
||||||
10
Sorting/SortResult.java
Normal file
10
Sorting/SortResult.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package Sorting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a class to hold the efficiencty results of a sorter. We will use this
|
||||||
|
* because we can only have one return value from a method, but want to get more
|
||||||
|
* than one piece of data from each sorter.
|
||||||
|
*/
|
||||||
|
public class SortResult {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,17 @@
|
|||||||
package Sorting;
|
package Sorting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is an abstract class, its subclasses will inherit its methods and instance
|
||||||
|
* fields. Any abstract methods will have to be implemented in the subclasses.
|
||||||
|
*/
|
||||||
abstract class Sorter {
|
abstract class Sorter {
|
||||||
//This is an abstract class
|
|
||||||
//In this class you will write an abstract sort() method
|
/**
|
||||||
//the method will be implemented by subclasses
|
* An abstract sorting method. Each subclass will have to implement its own
|
||||||
|
* version of this method.
|
||||||
|
* @return A SortResult object holding number of comparisons, number of swaps, and the sorted array
|
||||||
|
*/
|
||||||
|
public abstract SortResult sort();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user