databaseobject

What do you call a parent with no children?


I have some code where the user can delete one child record of a parent record one at a time. I'm detecting when there are no children left. At that point, I'm deleting the parent record as well. When coming up with a name for the variable, I realized I don't know what you call a parent with no children.

Is there a single, accepted name that I haven't heard of (or can't remember)?


Solution

  • Leaf: (no children)

    Terminal: (never children)

    Vacant: (had children)

    Orphan: (no parent)


    Leaf seems pretty standard according to wikipedia. "Terminal Node" on wikipedia will re-direct you to leaf node.

    Vacant node in more detail:

    Your orphanage had a child. The child got adopted and left. Your orpahage is now vacant.

    Terminal node in more detail:

    Example in OpenGL:

    An EBO references a VAO. A VAO references a VBO. A VBO is raw data and references nothing else.

    ( EBO --> VAO --> VBO )

    Thinking of the VBO as a "terminal node" would make more sense than thinking of it as a leaf. Because it will not and cannot have children.