check binary search tree