Improve isBST algorithm, without static variable