0
我怎样才能在此代码中的二进制树中的父?我怎样才能得到在二进制树中的父
我写了这个:
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;
}
}
和代码这对某些数据的树:
现在,我怎么能得到节点像父(新的节点(“22lltrk”,null,null)) 我需要添加到我的代码和哪里?
谢谢。
请出示你为了解决您的问题,试了一下代码。只显示树的初始化数据是不相关的代码 –
在第一次搜索时发现此问题http://stackoverflow.com/questions/30736577/find-the-parent-node-of-a-node-in-binary-search-树 –