コード例 #1
0
 public void setLeft(BinaryNode <T> left)
 {
     this.left = left;
 }
コード例 #2
0
 public void setRight(BinaryNode <T> right)
 {
     this.right = right;
 }
コード例 #3
0
 public int Size()
 {
     return(BinaryNode <T> .Size(root));
 }
コード例 #4
0
 public BinaryNode(T theElement, BinaryNode <T> left, BinaryNode <T> right)
 {
     this.element = theElement;
     this.left    = left;
     this.right   = right;
 }
コード例 #5
0
 public int CountNodesWithTwoChildren()
 {
     return(BinaryNode <T> .CountNodesWithTwoChildren(root));
 }
コード例 #6
0
 public void MakeEmpty()
 {
     root = null;
 }
コード例 #7
0
 public int CountNodesWithOneChild()
 {
     return(BinaryNode <T> .CountNodesWithOneChild(root));
 }
コード例 #8
0
 public int CountLeaves()
 {
     return(BinaryNode <T> .CountLeaves(root));
 }
コード例 #9
0
 public int Height()
 {
     return(BinaryNode <T> .Height(root));
 }
コード例 #10
0
 public BinaryTree(T rootItem)
 {
     root = new BinaryNode <T>(rootItem, null, null);
 }
コード例 #11
0
 public BinaryTree()
 {
     root = null;
 }