what is below data structure representing to?
sibtreenode firstchild; //first left node
sibtreenode nextsibling;//immediate next right sibling node for this node.
it is representing a non rooted binary tree
it is representing rooted binary tree
it is representing rooted tree
it is both a binary tree and normal tree, both are rooted.
This is representation of a simple rooted tree(not binary tree). binary tree will have maximum 2 children, since here we are using sibling pointer, that means a given node can have more than two children. in this representation each node is pointing to its parent, and a pointer to its left child, and a pointer to its sibling node(if any). same thing will repeat for each node.
Back To Top