Binary Tree representation of an m-child Tree

Hello Everyone!

I've been wanting to represent a tree with a maximum of m children per node as a binary tree but failed.
Could anyone suggest a solution?

Thanks!
Every node in the actual binary tree has a corresponding node in the hypothetical n-ary tree.
- The left child of the node in the actual binary tree must correspond to the leftmost child of the node (in some sense of order) in the hypothetical n-ary tree.
- The right child of the node in the binary tree must correspond to the right sibling (in the same sense of order as above) in the hypothetical n-ary tree. Sibling is like brother/sister, child of the same parent node.

This representation is called "left child-right sibling binary tree".

Regards
Topic archived. No new replies allowed.