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 firstname.lastname@example.org. 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.
- Sum of nodes at maximum depth of a Binary Tree
- Replace node with depth in a binary tree
- Find Minimum Depth of a Binary Tree
- Calculate depth of a full Binary tree from Preorder
- Depth of the deepest odd level node in Binary Tree
- 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
- Depth First Search or DFS for a Graph
- Applications of Depth First Search
- Iterative Depth First Traversal of Graph
- Top 10 Interview Questions on Depth First Search (DFS)
- Find maximum depth of nested parenthesis in a string
- Find depth of the deepest odd level leaf node
- Depth wise Separable Convolutional Neural Networks
- Flatten a multi-level linked list | Set 2 (Depth wise)