コード例 #1
0
        private static MyBinaryTree <int> GetADummyTree()
        {
            var tree = new MyBinaryTree <int>();

            tree.Root                     = new MyBinaryTreeNode <int>(15);
            tree.Root.LeftNode            = new MyBinaryTreeNode <int>(10);
            tree.Root.RightNode           = new MyBinaryTreeNode <int>(20);
            tree.Root.LeftNode.LeftNode   = new MyBinaryTreeNode <int>(8);
            tree.Root.LeftNode.RightNode  = new MyBinaryTreeNode <int>(12);
            tree.Root.RightNode.LeftNode  = new MyBinaryTreeNode <int>(18);
            tree.Root.RightNode.RightNode = new MyBinaryTreeNode <int>(22);

            return(tree);
        }
コード例 #2
0
 public InOrderTraversal(MyBinaryTree <T> tree)
 {
     Tree = tree;
 }