You are on page 1of 6

Page 1 of 6

TOPIC:- BASIC
TERMINOLOGIES OF
TREES

Page 2 of 6
SUMMA
RY
In linear data structure data is organized in
sequential order and in non-linear
data structure data is organized in
random order. A tree is a very
popular non-linear data structure
used in a wide range of
applications. A tree data structure
can be defined as follows...
Tree is a non-linear data structure which organizes data in
hierarchical structure and this is a recursive definition.
A tree data structure can also be defined as follows...
Tree data structure is a collection of data (Node) which is
organized in hierarchical structure recursively
In tree data structure, every individual element is called
as Node. Node in a tree
data structure stores the
actual data of that
particular element and
link to next element in
hierarchical structure.

In a tree data structure,


if we have N number of
nodes then we can have a maximum of N-1 number of links.

Page 3 of 6
KEYWO
 Root – The top node RDS
in a tree.
 Child – A node directly connected to another node when moving
away from the Root.
 Parent – The converse notion of a child.  Siblings – Nodes with
the same parent.
 Descendant – A node reachable by repeated
proceeding from parent to child.
 Ancestor – A node reachable by repeated
proceeding from child to parent.
 Leaf – A node with no children.
 Internal node – A node with at least one
child.
 External node – A node with no children.
 Degree – Number of sub trees of a node.
 Edge – Connection between one node to another.
 Path – A sequence of nodes and edges connecting a node with a
descendant.
 Level – The level of a node is defined by 1 + (the number of
connections between the node and the root).
 Height of node – The height of a node is the number of edges on
the longest downward path between that node and a leaf.
 Height of tree – The height of a tree is the height of its root node.
 Depth – The depth of a node is the number of edges from the node
to the tree's root node.  Forest – A forest is a set of n ≥ 0 disjoint
trees.

Page 4 of 6
DESCRIPTION
Tree is a hierarchical data structure that is defined as a collection of nodes. In a
tree nodes represent the values and are connected by edges. In a tree data
structure, we use the following terminology...
Terminology Description Diagram
Root Root node is a node from which the entire tree originates. It Node A
does not have a parent
Parent Node An immediate predecessor of any node is its parent node. B is parent of E & F

Child Node All immediate successors of a node are its children. The F & E are children of B
relationship between the parent and child is considered as
the parent-child relationship.
Leaf Node which does not have any child is a leaf. Usually the E, F, J, K, H, I are the leaf
boundary nodes of a tree or last nodes of the tree are the nodes.
leaf or collectively called leaves of the tree.
Edge Edge is the connection represented by a line between one Connecting line between A&B
node to another.In a tree with n nodes, there will be ‘n-1’ OR A&C OR B&F OR any
edges in a tree. other nodes connecting each
other.
Sibling Siblings in real life means people with the same parents, H&I are siblings
similarly in the case of trees, nodes with common parents
are considered to be siblings.
Path Path is a number of successive edges from source node to A ,C, G, K is path from node A
destination node. to K
Height of Node Height of a node represents the number of edges on the A, C, G, K form a height. Height
longest path between that node and a leaf. of A is no. of edges between A
and K, which is 3. Similarly, the
height of G is 1 as it has just
one edge until the next leaf
node.
Levels of Level of a node represents the generation of a node. If the Level of H, I & J is 3. Level of
root node is at level 0, then its next child node is at level 1, D, E, F & G is 2
Node its grandchild is at level 2, and so on
Degree of Degree of a node implies the number of child nodes a node Degree of D is 2 and of C is 3
has.
Node
Internal Node A node that has at least one child is known as an internal All the nodes except E, F, J, K,
node. H, I are internal.
Traversing Traversing is a process of visiting each node in a specific There are three types of
order in a tree data structure. traversals: inorder, preorder,
postorder traversal.
Ancestor An ancestor or ancestors to a node are all the predecessor A, C & G are ancestor to K and
nodes from root until that node. I.e. any parent or J nodes
Node grandparent and so on of a specific node are its ancestors.
Descendent Immediate successor of a node is its descendent. K is descendent of G

Subtree Immediate successor of a node is its descendent. Nodes B, E, F represent one


subtree.

Page 5 of 6
CONCLUSION
A tree data structure is defined as a collection of objects
or entities known as nodes that are linked together to
represent a hierarchy. A tree is recursive in nature as it
is a recursive data structure. It is so because each tree
contains multiple subtrees, as each node in a tree is a
root node to another tree that makes it a subtree. A tree
has multiple applications like: Traversing: that allows
us or a program to traverse through an object model like
Document Object Model. Searching: in a structure like
a binary search tree, it's easier to search for an element
as smaller elements are located in the left subtree and
greater elements are located in the right subtree.
Decision Making: A flow of an application can be
represented in a hierarchical structure that allows us to
understand all the decisions that a user can make.
Machine Learning: Machine learning allows us to
make automatic decision-making framework that was
made possible with tree data structure. There are
multiple types of trees but the most common of all is
the Binary Search Tree.

Page 6 of 6

You might also like