Given an N-Ary tree, find depth of the tree. An N-Ary tree is a tree in which nodes can have at most N children.
N-Ary tree can be traversed just like a normal tree. We just have to consider all childs of a given node and recursively call that function on every node.
This article is contributed by Shubham Gupta. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Replace node with depth in a binary tree
- Sum of nodes at maximum depth of a Binary Tree
- Find Minimum Depth of a Binary Tree
- Sum of nodes at maximum depth of a Binary Tree | Set 2
- Depth of the deepest odd level node in Binary Tree
- Calculate depth of a full Binary tree from Preorder
- Sum of nodes at maximum depth of a Binary Tree | Iterative Approach
- Write a Program to Find the Maximum Depth or Height of a Tree
- Find depth of the deepest odd level leaf node
- Maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST
- Complexity of different operations in Binary tree, Binary Search Tree and AVL tree
- Print Binary Tree levels in sorted order | Set 3 (Tree given as array)
- Convert an arbitrary Binary Tree to a tree that holds Children Sum Property
- Given level order traversal of a Binary Tree, check if the Tree is a Min-Heap
- Check if a given Binary Tree is height balanced like a Red-Black Tree