Does any one know why binary trees are upside down , meaning that the root is a the top while in an actual tree the root is at the bottom ?
thanx![]()
|
Does any one know why binary trees are upside down , meaning that the root is a the top while in an actual tree the root is at the bottom ?
thanx![]()
Because of convention. In the computer science community, one tends to conceptualize things that belong to an object as below that object. So a root has a left and a right node that belongs to it, so we tend to think of them as below the root.
my professor said that this is not the answer , there is a special reason why we call it a tree and that the root is a the top and not the bottom
i doubt whether the name "root node" should be taken as equivalent to the root of a tree, more root as the starting point from which all child nodes are derived
as for why have the root node should be at the top of the diagram, i'm sure that's pure convention, indicating that the derived nodes are shown lower than their parent nodes + someone has decide that "is derived from" should be shown as below the node from which it is derived
tbh i think your professor is looking for one specific reason why the convention took hold, but convention it still is
(as a programmer you tend not to take too much notice of the guys who teach because they can't do)
I suspect that your professor is gravely mistaken.
« My first post and an optics question rolled into one | Physics » |