So I've looked around the web and a couple of questions here in stackoverflow here are the definition:
- Generally, an internal node is any node that is not a leaf (a node with no children)
- Non-leaf/Non-terminal/Internal node – has at least one child or descendant node with degree not equal to 0
- As far as i understand it, it is a node which is not a leaf.
I was about to conclude that the root is also an internal node but there seems to be some ambiguity on its definition as seen here:
What is an "internal node" in a binary search tree?
- As the wonderful picture shows, internal nodes are nodes located between the root of the tree and the leaves
If we follow that definition then the root node isn't going to be counted as an internal node. So is a root node an internal node or not?