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>>();
source share