What is Generic Tree or N-ary Tree Last Updated : 26 Sep, 2023 Data Structure and Algorithms Course Recent articles on N-ary Tree What is a N-ary Tree? Generic trees are a collection of nodes where each node is a data structure that consists of records and a list of references to its children(duplicate references are not allowed). Unlike the linked list, each node stores the address of multiple nodes. Every node stores the address of its children and the very first node’s address will be stored in a separate pointer called root. The Generic trees are the N-ary trees which have the following properties: Many children at every node. The number of nodes for each node is not known in advance. Example: Generic Trees(N-array Trees) Introduction: Generic Trees(N-array Trees) Easy Problems Depth of an N-Ary tree Number of nodes greater than a given value in n-ary tree General Tree Level Order Traversal DFS for a n-ary tree represented as adjacency list Height of n-ary tree if parent array is given Number of special nodes in an n-ary tree Preorder Traversal of N-ary Tree Without Recursion Print all leaf nodes of an n-ary tree using DFS Count the nodes in the given tree whose weight is even parity Difference between sums of odd level and even level nodes in an N-ary Tree Remove all leaf nodes from a Generic Tree or N-ary Tree Level Order Traversal of N-ary Tree Intermediate Problems Diameter of an N-ary tree Number of ways to traverse an N-ary tree Mirror of n-ary Tree Locking and Unlocking of Resources arranged in the form of n-ary Tree Height of a generic tree from parent array Next Larger element in n-ary tree Second Largest element in n-ary tree Left-Child Right-Sibling Representation of Tree Longest path in an undirected tree DP on Trees | Set-3 ( Diameter of N-ary Tree ) Iterative Preorder Traversal of an N-ary Tree Immediate Smaller element in an N-ary Tree Iterative Postorder Traversal of N-ary Tree Maximum level sum in N-ary Tree Replace every node with depth in N-ary Generic Tree Count of subtrees from an N-ary tree consisting of single colored nodes Find if path length is even or odd between given Tree nodes for Q queries Maximize sum of path from the Root to a Leaf node in N-ary Tree Kth Smallest Element in an N-ary Tree Count of subtrees possible from an N-ary Tree Convert a Generic Tree(N-array Tree) to Binary Tree Check if given Generic N-ary Tree is Symmetric horizontally ZigZag Level Order Traversal of an N-ary Tree Hard Problems LCA for n-ary Tree | Constant Query O(1) Serialize and Deserialize an N-ary Tree Construct the full k-ary tree from its preorder traversal GCD from root to leaf path in an N-ary tree Level with maximum number of nodes using DFS in a N-ary tree Find distance of nodes from root in a tree for multiple queries Kth ancestor of all nodes in an N-ary tree using DFS Find node U containing all nodes from a set V at atmost distance 1 from the path from root to U Find the node at the center of an N-ary tree Maximum weighted edge in path between two nodes in an N-ary tree using binary lifting Minimum distance between two given nodes in an N-ary tree Minimum time required to color all edges of a Tree Construct a Complete N-ary Tree from given Postorder Traversal Number of leaf nodes in a perfect N-ary tree of height K Count of nodes in a given N-ary tree having distance to all leaf nodes equal in their subtree If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.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 Share your thoughts in the comments Add Your Comment Please Login to comment...