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 descriptiveChildNode
-- short, but potentially misleadingParentedNode
-- I like this oneNestedNode
-- 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
精彩评论