Shezad Ahmed
asked on
Binary Search Tree Create Node
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and here is a small demo
using System;
public class Program
{
public class Node
{
public int id{get;set;}
public Node LeftNode {get;set;}
public Node RightNode {get;set;}
}
public static void Main()
{
Node n = new Node(); n.id=10;
Node ln = new Node(); ln.id=9;
Node rn = new Node(); rn.id=11;
n.LeftNode=ln;n.RightNode=rn;
Console.WriteLine("RN: = " + n.RightNode.id);
Console.WriteLine("LN: = " + n.LeftNode.id);
}
}
maybe you should use BST instead...