Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java Parameters and Inheritance question

Name: Javafag 2007-06-07 15:06 ID:8FwQmpEe

Building a Red-Black Tree for a project. Right now I've got a working Binary Search Tree with constructors:

public class BSTree <T extends Comparable>{
    private BSTNode<T> root;
   
    public BSTree(){
    }
    public BSTree(BSTNode<T> n){
        root=n;
    }
    public BSTree(T c){
        root=new BSTNode<T>(c);
    }

And then I've got the Red-Black Tree's constructors:

public class RBTree <T extends Comparable> extends BSTree{
   
    public RBTree (){
        super();
    }
    public RBTree (T c){
        super(c);
    }
    public RBTree (BSTNode<T> n){
        super(n);
    }

My question: Will this handle Parameters correctly? Ex, if I make a RBTree<Integer>(), will it run BSTree<Integer>(), or just BSTree() ?

Sorry for Java faggotry, it's the only language my school teaches.

Name: Anonymous 2007-06-09 18:37 ID:HG2DFXiU

>>25
The classic NP complete problem is the travelling salesman. The solution is to enumerate all possible routes. There is no way to say that any given route is the shortest without enumerating all of them.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List