check BST cpp