示例#1
0
 public override string ToString()
 {
     if (root == null)
     {
         return("<empty tree>");
     }
     return(root.ToStringFormatted(0));
 }
示例#2
0
 public string ToStringFormatted(int tabIndex)
 {
     return((new string(' ', tabIndex)) + "coord=" + coords.ToString() + ", value=" + value.ToString() + "\n" +
            (new string(' ', tabIndex)) + " left: " +
            (left == null ? "<null>" : ("\n" + left.ToStringFormatted(tabIndex + 6))) +
            "\n" + (new string(' ', tabIndex)) + " right: " +
            (right == null ? "<null>" : ("\n" + right.ToStringFormatted(tabIndex + 6))) + "\n");
 }