public static String postorderPrint(Tree T, Position v) { String s = ""; Iterator children = T.children(v); while (children.hasNext()) s += postorderPrint(T, (Position) children.next()) + " "; s += v.element(); // elements must implement toString return s; }