separate class BINARY_TREE [T] feature left : BINARY_TREE [T] right : BINARY_TREE [T] nodes : INTEGER update_nodes is do nodes := 1 compute_nodes(left) compute_nodes(right) adjust_nodes(left) adjust_nodes(right) end compute_nodes(b : BINARY_TREE [T]) is do if b /= Void then b.update_nodes end end adjust_nodes(b : BINARY_TREE [T]) is do if b /= Void then nodes := nodes + b.nodes end end end -- class BINARY_TREE