Search:

Type: Posts; User: helloworld922

Search: Search took 0.07 seconds.

  1. Replies
    9
    Views
    7,187

    Re: Binary Search Tree

    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
    ...
  2. Replies
    9
    Views
    7,187

    Re: Binary Search Tree

    In you're insert method you need to check for a null root node. Then, if it is null, create a new node.
Results 1 to 2 of 2