Example 1: Output for above tree should be 20 8 22 4 12 10 14 Example 2: 1 / \ 2 3 / \ \ 4 5 6 / \ / 7 8 9 Output for above tree should be 1 2 3 4 5 6 7 8 9<