25
Sep
Tree is a hierarchical data structure that consists of nodes connected by edges. It is a non-linear structure, which means that unlike arrays, linked lists, stacks, or queues, elements are not arranged in a sequential manner. Basic Concepts: Root:The topmost node in the tree. There is exactly one root node in a tree.Nodes: Basic units of a tree containing data and references to other nodes.Edges: Links between nodes, showing the relationship from parent to child.Parent: A node that has one or more child nodes.Child: A node that has a parent node.Leaf/Terminal node: A node that does not have any children.Subtree:…