Is the root node an internal node?

后端 未结 4 1819
滥情空心
滥情空心 2021-02-20 05:57

So I\'ve looked around the web and a couple of questions here in stackoverflow here are the definition:

  • Generally, an internal node is any node that is not a leaf
4条回答
  •  感动是毒
    2021-02-20 06:29

    "A node with no children is a leaf or external node. A non-leaf node is an internal node."

    Source: "Introduction To Algorithms-3rd edition" page number 1176, last line.

    So, root is also an internal node except when it is the only node of the tree.

提交回复
热议问题