// Textbook fragment 07.07 public static int height2 (Tree T, Position v) { if (T.isExternal(v)) return 0; int h = 0; for (Position w : T.children(v)) h = Math.max(h, height2(T, w)); return 1 + h; }