How can i get the Parent in Binary tree in this code ?
I wrote this :
public class Node
{
public string state;
public Node Left;
public Node Right;
public Node (string s , Node L , Node R )
{
this.state = s;
this.Right = R;
this.Left = L;
}
public Node (string s)
{
this.state = s;
this.Right = null;
this.Left = null;
}
}
And code this for tree of some data :
Now , how can i get the parent of Node like ( new Node("22lltrk", null, null) ) what i need to add to my code and where ?
thanks .