PDA

View Full Version : Java - binary search tree node constructor


Scrubdilla
Apr 27, 2010, 07:09 PM
I am trying to create a node constructor that intializes a string for a data spot in the node and a list for a list in the node.

I have tried this:

public String data;
public List dinosaur;
public Node ( String _data )
{
data = _data;
dinosaur = new List();
}

It doesn't seem to work right, any ideas?

jmd814
May 19, 2010, 11:15 AM
This code is correct, you will need to provide more context and details about what it means to not work right