📜  根节点是内部节点吗 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:15.039000             🧑  作者: Mango

代码示例1
Yes! root node is an internal node.

[More explanation]
A root node is never called as a leaf node even if it is the only node present in the tree. For ex. if a tree has only one node then we say that it is a tree with only root node, we never say that the tree has a single leaf node.
Since internal node means a non-leaf node and because root node is never considered as leaf node I would say that in case of single node tree root node is an internal node.