// Textbook fragment 07.13 public static int diskSpace (Tree T, Position v) { int s = size(v); // start with the size of the node itself for (Position w : T.children(v)) // add the recursively computed space used by the children of v s += diskSpace(T, w); if (T.isInternal(v)) { // print name and disk space used System.out.print(name(v) + ": " + s); } return s; }