LeetCode - Lowest Common Ancestor of a Binary Search Tree 知识点 1. Binary Search Tree: left<root<right 2.如果根节点的值大于p和q之间的较大值,说明p和q都在左子树中,那么此时我们就进入根节点的左子节点继续递归,如果根节点小于p和q之间的较小值,说明p和q都在右子树中,那么此时我们就进入根节点...
Learn how to do deletion in a binary search tree using C++, its time complexity, and why deleting a node in BST is difficult.