code: private int depth() {
          int i = 0;
          for (TreeString p = this; p != null; p = p.parent) {
              i++;
          }
          return i;
      }
docs: How many nodes do we have from the root to this node (including 'this'
  itself?) Thus depth of the root node is 1.