Skip to content

Instantly share code, notes, and snippets.

@emsesc
Created February 28, 2023 17:41
Show Gist options
  • Save emsesc/729832bc62e9cbe14d49553dd8213c8e to your computer and use it in GitHub Desktop.
Save emsesc/729832bc62e9cbe14d49553dd8213c8e to your computer and use it in GitHub Desktop.
package a3;
public class Main {
public static void main(String[] args){
/*
* You will test your own bst implementation in here.
* Do what you wish to in Main, as we will not be running it.
* The grader uses its own Main and calls the methods of your other classes.
*
* In order to test you should create BST objects, put data into them,
* take data out, look for values stored in it, checking size, and looking
* at the Nodes to see if they are all linked up correctly as a BST.
*
* The Tester class we give you as a suggested way to organize your tests
* and allow you to systematically build your ADT method by method,
* testing as you go, adding new tests as you add new code.
*
* You will be able to comment in and out various tests easily as you work
* as I have done below.
*
*/
BST bst = new BSTImpl();
Tester tst = new Tester();
tst.insert(bst);
tst.findMin(bst);
tst.findMax(bst);
tst.get(bst);
tst.isFullBT(bst);
BST bst3 = new BSTImpl();
tst.getMaxLeafHeightDiff(bst3);
BST bst2 = new BSTImpl();
tst.merge(bst2);
// etc...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment