code: public void updateStartEnd() {
          ArrayList<IntBinaryTree> leaves = getLeaves();
          for (int i=0; i<leaves.size(); i++) {
              IntBinaryTree leaf = leaves.get(i);
              leaf.start = i;
              leaf.end = i+1;
          }
          postOrderTraversal(new UpdateStartEnd());
      }
docs: Updates all the start end fields, treating the current node as the root.