Archive for the ‘code’ Category
Four Sorts, Java
Here’s a project I’ve been working on in one of my CS classes.
Click the button below to launch the application:
The application compares the four sorting algorithms, quick sort, heap sort, merge sort and insertion sort, by graphically displaying the data members of the tree as they get sorted. Here’s the source if you’re interested.
The data structure used to store the data members is a tree that implements the ArrayList functions add, set, get, isEmpty, and size. The tree stores nodes and the nodes store dots:
class Node {
private int n;
private Node parent;
private Node left;
private Node right;
private Dot dot;
...
}
class Dot {
int value;
...
}
Post any comments below.
Hello World!
class HelloWorld{
public static void main (String [] args){
System.out.println("Hello World!");
}
}
