glenn
glenn

Reputation: 651

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

Root covers the root, what are the rest of the nodes collectively called?

Upvotes: 6

Views: 1682

Answers (4)

Daniel Wolf
Daniel Wolf

Reputation: 13663

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

Upvotes: 3

Axel Fontaine
Axel Fontaine

Reputation: 35169

Just like in the real world: branches and leaves

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

Upvotes: 3

qwertymk
qwertymk

Reputation: 35294

        R
       / \
      B   L
     / \
    L   B
       /
      L

R is root, B are branches L are leaves

Upvotes: 1

Dave
Dave

Reputation: 3448

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

Upvotes: 2

Related Questions