I need an algorithm or pseudo code for the following problem:
Initialize sibling pointers of a tree level by level starting with the root.
This is the tree representation before:
Level 1: A (no sibling pointers)
Level 2: B, C (children of A) (no sibling pointers)
Level 3: D (children of B), F, G (children of C) (no sibling pointers)
Level 1: A
Level 2: B -> C
Level 3: D -> F -> G
Traversal result would be ABCDEFG.