0% found this document useful (0 votes)
7 views2 pages

Write An Assignment On The Topic Tree Terminolog..

Nothing

Uploaded by

harishekar45
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
7 views2 pages

Write An Assignment On The Topic Tree Terminolog..

Nothing

Uploaded by

harishekar45
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

Tree Terminologies in Data Structures

Introduction
Trees are a fundamental data structure in computer science, characterized by their hierarchical
structure. They are used to represent various real-world scenarios, from file systems to
organizational charts. Understanding the key terminologies associated with trees is essential for
effectively working with them. This assignment delves into the core concepts of tree data
structures, providing a comprehensive overview of their terminology.
Basic Tree Terminologies
1. Node: The fundamental unit of a tree, representing a data element.
2. Root: The topmost node of a tree, which has no parent.
3. Parent: A node that has one or more child nodes.
4. Child: A node that is directly below another node.
5. Sibling: Nodes that share the same parent.
6. Leaf (Terminal Node): A node that has no children.
7. Internal Node: A node that has at least one child.
8. Degree of a Node: The number of children a node has.
9. Depth of a Node: The number of edges from the root to the node.
10. Height of a Node: The number of edges from the node to the deepest leaf in its subtree.
11. Height of a Tree: The height of the root node.
12. Level of a Node: The depth of the node plus one.
Tree Types
1. Binary Tree: A tree in which each node has at most two children.
○ Full Binary Tree: A binary tree in which every node has either zero or two children.
○ Complete Binary Tree: A binary tree in which every level, except possibly the last,
is completely filled, and all nodes are as far left as possible.
○ Perfect Binary Tree: A binary tree in which all internal nodes have two children,
and all leaves are at the same level.
2. N-ary Tree: A tree in which each node can have at most N children.
3. General Tree: A tree without any restrictions on the number of children a node can have.
Tree Traversals
1. Preorder Traversal: Visit the root node, then recursively traverse the left subtree, and
finally the right subtree.
2. Inorder Traversal: Recursively traverse the left subtree, visit the root node, and then
recursively traverse the right subtree.
3. Postorder Traversal: Recursively traverse the left subtree, recursively traverse the right
subtree, and finally visit the root node.
4. Level Order Traversal: Visit nodes level by level, starting from the root.
Applications of Trees
Trees find applications in various domains, including:
● File Systems: Representing hierarchical file structures.
● Organizational Charts: Depicting hierarchical relationships within organizations.
● Syntax Trees: Representing the syntactic structure of programming languages.
● Decision Trees: Making decisions based on a series of conditions.
● Game Trees: Analyzing game strategies and making optimal moves.
● Binary Search Trees: Efficiently storing and searching data.
● Heaps: Implementing priority queues and efficient sorting algorithms.
Conclusion
A solid understanding of tree terminologies is crucial for effectively working with tree data
structures. By grasping the concepts of nodes, parents, children, and tree traversals, you can
efficiently implement and analyze tree-based algorithms. Trees are versatile data structures that
find applications in numerous fields, making them an essential tool in the data structures and
algorithms toolbox.
● https://www.studocu.com/row/document/jahangirnagar-university/data-structure/data-struc
ture-and-algorithm/84276553
● https://github.com/jinchen-hu/ADT_Algo_Exercises

You might also like