validate binary search-tree