【问题标题】:What is node in a tree?什么是树中的节点?
【发布时间】:2015-04-29 23:39:57
【问题描述】:

根据wiki,树中的一切都是一个节点。

树中使用的术语

Root – The top node in a tree.
Parent – The converse notion of child.
Siblings – Nodes with the same parent.
Descendant – a node reachable by repeated proceeding from parent to child.
Ancestor – a node reachable by repeated proceeding from child to parent.
Leaf – a node with no children.
Internal node – a node with at least one child.
External node – a node with no children.
Degree – number of sub trees of a node.
Edge – connection between one node to another.
Path – a sequence of nodes and edges connecting a node with a descendant.
Level – The level of a node is defined by 1 + the number of connections between the node and the root.
Height of tree –The height of a tree is the number of edges on the longest downward path between the root and a leaf.
Height of node –The height of a node is the number of edges on the longest downward path between that node and a leaf.
Depth –The depth of a node is the number of edges from the node to the tree's root node.
Forest – A forest is a set of n ≥ 0 disjoint trees.

但是后来我从SAPhttp://www.sapdesignguild.org/community/design/print_hierarchies2.asp找到了下面这张图

所以我的问题 - 将树中的根、叶、父母、孩子、兄弟姐妹称为节点是否正确?

【问题讨论】:

    标签: data-structures tree nodes treenode


    【解决方案1】:

    是的。根是“根节点”。父节点是“父节点”。叶是“叶节点”。树由节点组成。根、父、子、兄弟、叶等术语只是描述了节点之间的关系。

    例如,根节点没有父节点。叶节点没有子节点。兄弟节点共享同一个父节点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-03-14
      • 2021-04-19
      • 2013-09-25
      • 2021-05-22
      • 1970-01-01
      • 2014-09-18
      • 1970-01-01
      相关资源
      最近更新 更多