public static int width(IntBST t) { return (t == null) ? 0 : (t.isLeaf() ? 2 : ((t.left() == null && t.right() != null) ? 1 + width(t.right()) : ((t.left() != null && t.right() == null) ? 1 + width(t.left()) : width(t.left()) + width(t.right()) ) ) ); }