no, like this:
public void insert(int data)
{
if (root == null)
{
root = new Node(); // err, i'm not sure i know what you're node constructor looks like, but put it here
...
Type: Posts; User: helloworld922
no, like this:
public void insert(int data)
{
if (root == null)
{
root = new Node(); // err, i'm not sure i know what you're node constructor looks like, but put it here
...
In you're insert method you need to check for a null root node. Then, if it is null, create a new node.