Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
二叉搜索树(BST)中节点的深度是否与它与根的距离相同?我想是的,但我不确定。我相信距离是一般树的概念,深度是应用于 BST 的概念。
是的,深度=距根的距离。从这里:
节点的深度 n 是从根到节点的路径长度。