C#中的二叉树

|                                                                                                                       
已邀请:
        
class Node<T>
{
    public Node<T> Left, Right;
    public T Value;
}
    
        
class Node
{
  public Node left, right;
  public int value;
}
    
        
namespace ConsoleApplication1
{
    public class binarytreeNode
    {
        public binarytreeNode Left;
        public binarytreeNode Right;
        public int data;

    }
    public class binarytree
    {
        public binarytreeNode AddNode(int value)
            {
                binarytreeNode newnode = new binarytreeNode();
                newnode.Left = null;
                newnode.Right = null;
                newnode.data = value;
                return newnode;
            }
    }
    class Program
    {       

         static void Main(string[] args)
        {
            binarytree mybtree = new binarytree();

            binarytreeNode head = mybtree.AddNode(4);

        }
    }
}
    

要回复问题请先登录注册