Given a binary tree. Print the Top View of Binary Tree. Print the nodes from left to right order.
Example:Input:
Output: 2 35 2 10 2
1
5 35 10 2 3 5 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
Sample Output 1:
2 35 5 10 2
Sample Input 2:
2
5 -1 6 -1 -1
5 6 -1 -1 -1
Sample Output 2:
5 6
6 5