return unless defined $$tree->{left} and defined $$tree->{right};