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は、ルートからノードまでのパスの長さです。