开发者

Is there a term to describe all non-root nodes in a tree?

Root covers the root, wha开发者_运维知识库t are the rest of the nodes collectively called?


Just like in the real world: branches and leaves

They are all child nodes (of the root or some other node).


I had the same problem -- I was creating a base class for all non-root nodes and was looking for a succinct name. Here's what I came up with (and I realize none of these is perfect):

  • NonRootNode -- this is a bit clumsy, but certainly descriptive
  • ChildNode -- short, but potentially misleading
  • ParentedNode -- I like this one
  • NestedNode -- might work depending on the context


In the middle they're called branches. On the very ends, they're leaves.


        R
       / \
      B   L
     / \
    L   B
       /
      L

R is root, B are branches L are leaves

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜