0% found this document useful (0 votes)
154 views

Introduction To Tree Data Structure

Tree data structures represent nodes connected by edges. A tree has a root node that can have zero or more subtrees, with each subtree rooted by nodes connected directly to the root by edges. Key terms include path, root, parent, child, sibling, degree of node, leaf, subtree, traversing, levels, depth, height, and ancestor/descendant nodes.

Uploaded by

PRABHAKAR MORE
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views

Introduction To Tree Data Structure

Tree data structures represent nodes connected by edges. A tree has a root node that can have zero or more subtrees, with each subtree rooted by nodes connected directly to the root by edges. Key terms include path, root, parent, child, sibling, degree of node, leaf, subtree, traversing, levels, depth, height, and ancestor/descendant nodes.

Uploaded by

PRABHAKAR MORE
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Introduction to Tree Data Structure:

Tree represents the nodes connected by edges.


A tree is a collection of elements called nodes, one of which is distinguished as a
“root”. The root can have zero or more non-empty subtree each of whose roots are connectd
by directed edge from root.

Important Terms
 Path − Path refers to the sequence of nodes along the edges of a tree.
 Root − The node at the top of the tree is called root. There is only one root per tree
and one path from the root node to any node.
 Parent − Any node except the root node has one edge upward to a node called parent.
 Child − The node below a given node connected by its edge downward is called its
child node.
 Siblings: Node with the same parent are siblings.
 Degree of Node: The degree of node is number of children of node. The degree of
node A, B and C is 2.
 Leaf − The node which does not have any child node is called the leaf node.
 Subtree − Subtree represents the descendants of a node.
 Traversing − Traversing means passing through nodes in a specific order.
 Levels − Level of a node represents the generation of a node. If the root node is at
level 0, then its next child node is at level 1, its grandchild is at level 2, and so on.
 Depth- The depth of binary tree is the maximum level of any node in tree. This is
equal to the longest path from the root to any leaf node. The depth of above tree is 3.
 Depth/Height of Tree: The height of a tree is the distance of the root node from its
farthest descendant. The height of above tree is 3.
 Ancestor/descendant node- All the nodes on the path leading to root node are
ancestors of a node. In above tree the ancestors of node J are E, B, A.

You might also like