Left-Child Right-Sibling Representation is a different representation of an n-ary tree where instead of maintaining a pointer to each and every child node, a node holds just two pointers, first a pointer to its first child, and the other pointer to its immediate next sibling. This new transformation not only eliminates the need of prior knowledge of the number of children a node has, but also restricts the number of pointers to a maximum of two, so making it so much simpler to code.
At each node, link or connect children of same parent from left to right.
Parent should be linked with only first child.
Left Child Right Sibling tree representation
10 | 2 -> 3 -> 4 -> 5 | | 6 7 -> 8 -> 9