Depth of an N-Ary tree - GeeksforGeeks
![](https://media.geeksforgeeks.org/wp-content/cdn-uploads/NAry2.png)
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
A computer science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
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. Algorithm Here is the algorithm for finding the depth of an N-Ary tree 1)Define a struct for the nodes of the N-ary tree with a key
![](https://media.geeksforgeeks.org/wp-content/cdn-uploads/NAry2.png)
Depth of an N-Ary tree - GeeksforGeeks
![](https://videocdn.geeksforgeeks.org/geeksforgeeks/DepthofanNArytree/DepthofanNArytree20220601133454.jpg)
Depth of an N-Ary tree - GeeksforGeeks
![](https://videocdn.geeksforgeeks.org/geeksforgeeks/AprogramtocheckifabinarytreeisBSTornot/AprogramtocheckifabinarytreeisBSTornot20221020125200-small.png)
Depth of an N-Ary tree - GeeksforGeeks
![](https://videocdn.geeksforgeeks.org/geeksforgeeks/DeleteNodeOperationinBinarySearchTreeBST/DeleteNodeOperationinBinarySearchTreeBST20220613122811-small.png)
Depth of an N-Ary tree - GeeksforGeeks
![](https://videocdn.geeksforgeeks.org/geeksforgeeks/FindapairwithgivensuminBST/FindapairwithgivensuminBST20220601171809-small.png)
GeeksforGeeks
![](https://media.geeksforgeeks.org/wp-content/cdn-uploads/NArry1.png)
Depth of an N-Ary tree - GeeksforGeeks