Given a Binary Tree, find the In-Order Traversal of it.
Input: 1 / \ 3 2 Output: 3 1 2
Input: 10 / \ 20 30 / \ / 40 60 50 Output: 40 20 60 10 50 30
You don't need to read input or print anything. Your task is to complete the function inOrder() that takes root node of the tree as input and returns a list containing the In-Order Traversal of the given Binary Tree.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(N).
1 <= Number of nodes <= 105
1 <= Data of a node <= 105
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.