Given a Binary Tree. Check whether the Binary tree is a full binary tree or not.
Explanation: Every node except leaf node
has two children so it is a full tree.
Explanation: Node 2 has only one child
so this is not a full tree.
Your Task: You don't need to read input or print anything. Your task is to complete the functionisFullTree() which takes the root node of the treeas input and returns True if the given Binary Tree is full. Else, it returns False. (The driver code will print 1 if the returned value is true, otherwise 0).
Expected Time Complexity: O(N). Expected Auxiliary Space: O(Height of the Tree).
1<=Number of nodes<=1000
Note:The Input/Ouput format and Example given are used for system's internal purpose, and should be used by a user for Expected Output only. As it is a function problem, hence a user should not read any input from stdin/console. The task is to complete the function specified, and not to write the full code.