public class BinaryTreeNode<T>
{
public T Value {get; set;}
public BinaryTreeNode<T> Left {get; set;}
public BinaryTreeNode<T> Right {get; set;}
public BinaryTreeNode<T> Seach(T forWhat)
{
if(Value == forWhat) return this;
BinaryTreeNode<T> leftResult = Left.Search(forWhat);
if(leftResult != null) return leftResult;
BinaryTreeNode<T> rightResult = Right.Search(forWhat);
if(rightResult != null) return rightResult;
return null;
}
}
BinaryTreeNode<Tuple<double, double, double>> threeDoublesTree = new BinaryTreeNode<Tuple<double, double, double>>();
BinaryTreeNode<Tuple<double, double, double, double, double, double>> sixDoublesTree = new BinaryTreeNode<Tuple<double, double, double, double, double, double>>();
이 트리를 구현하는 언어는 무엇입니까? –
C#으로 구현하고 있습니다. –