You don't need to read input or print anything. The task is to complete the function diagonal() that takes the root nodeas input argumetsand returns the diagonal traversal of the given tree.
Expected Time Complexity: O(N). Expected Auxiliary Space: O(N). Here N is number of nodes.
1 <= Number of nodes<= 105
1 <= Data of a node<= 105