if terminal node
if((left(p) == null) && (right(p) == null))