Print all the levels with odd and even number of nodes in it | Set-2 - GeeksforGeeks
Print all the levels with odd and even number of nodes in it | Set-2
Given an N-ary tree, print all the levels with odd and even number of nodes in it.
Examples:
For example consider the following tree 1 - Level 1 / \ 2 3 - Level 2 / \ \ 4 5 6 - Level 3 / \ / 7 8 9 - Level 4 The levels with odd number of nodes are: 1 3 4 The levels with even number of nodes are: 2
Read full article from Print all the levels with odd and even number of nodes in it | Set-2 - GeeksforGeeks
No comments:
Post a Comment