Example
Input Tree A / \ B C / \ \ D E F Output Tree A---> NULL / \ B--> C--> NULL / \ \ D--> E--> F--> NULL
Method 1 (Extend Level Order Traversal or BFS)
Input Tree A / \ B C / \ \ D E F Output Tree A---> NULL / \ B--> C--> NULL / \ \ D--> E--> F--> NULL
2 / \ 1 3is changed to…
2 / \ 2 3 / / 1 3 / 1And the tree
1 / \ 2 3 / \ 4 5is changed to
1 / \ 1 3 / / 2 3 / \ 2 5 / / 4 5 / 4