// Textbook fragment 07.05 public static int height1 (Tree T) { int h = 0; for (Position v : T.positions()) { if (T.isExternal(v)) h = Math.max(h, depth(T, v)); } return h; }