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

PPT 3.1.1 Representation of Tree (1)

data structure

Uploaded by

studying449
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

PPT 3.1.1 Representation of Tree (1)

data structure

Uploaded by

studying449
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

UNIVERSITY INSTITUTE OF COMPUTING

Bachelor of Computer Application


Subject Name: Data Structure
23CAT-201/ 23SCT-201
VISION

To be a Centre of Excellence for nurturing computer professionals with


strong application expertise through experiential learning and research
for matching the requirements of industry and society instilling in them
the spirit of innovation and entrepreneurship.

2
Mission of the Department

M1. To provide innovative learning centric facilities and quality-


oriented teaching learning process for solving computational problems.
M2. To provide a frame work through Project Based Learning to
support society and industry in promoting a multidisciplinary activity.
M3. To develop crystal clear evaluation system and experiential
learning mechanism aligned with futuristic technologies and industry.
M4. To provide doorway for promoting research, innovation and
entrepreneurship skills incollaboration with industry and academia.
M5. To undertake societal activities for upliftment of rural/deprived
sections of the society.
3
Program Outcomes
• PO1 Apply mathematics and computing fundamental and domain concepts to find out the solution of defined problems and requirements. (Computational
Knowledge)
• PO2 Use fundamental principle of Mathematics and Computing to identify, formulate research literature for solving complex problems, reaching appropriate
solutions. (Problem Analysis)
• PO3 Understand to design, analyze and develop solutions and evaluate system components or processes to meet specific need for local, regional and global public
health, societal, cultural, and environmental systems.
• PO4 (Design /Development of Solutions)Use expertise research-based knowledge and methods including skills for analysis and development of information to
reach valid conclusions. (Conduct Investigations of Complex Computing Problems)
• PO5 Adapt, apply appropriate modern computing tools and techniques to solve computing activities keeping in view the limitations. (Modern Tool Usage)
• PO6 Exhibiting ethics for regulations, responsibilities and norms in professional computing practices. (Professional Ethics)
• PO7 Enlighten knowledge to enhance understanding and building research, strategies in independent learning for continual development as computer applications
professional. (Life-long Learning)
• PO8 Establishing strategies in developing and implementing ideas in multi- disciplinary environments using computing and management skills as a member or
leader in a team. (Project Management and Finance)
• PO9 Contribute to progressive community and society in comprehending computing activities by writing effective reports, designing documentation, making
effective presentation, and understand instructions. (Communication Efficacy)
• PO10 Apply mathematics and computing knowledge to access and solve issues relating to health, safety, societal, environmental, legal, and cultural issues within
local, regional and global context. (Societal and Environmental Concern)
• PO11 Gain confidence for self and continuous learning to improve knowledge and competence as a member or leader of a team. (Individual and Teamwork)
• PO12 Learn to innovate, design and develop solutions for solving real life business problems and addressing business development issues with a passion for quality
competency and holistic approach. (Innovation and Entrepreneurship)

4
Program Educational Objectives

PEO1 Demonstrate analytical and design skills including the ability to generate creative solutions and foster
team-oriented professionalism through effective communication in their careers.
PEO2 Expertise in successful careers based on their understanding of formal and practical methods of
application development using the concept of computer programming languages and design principles in
accordance to industry 4.0
PEO3 Exhibit the growth of the nation and society by implementing and acquiring knowledge of upliftment of
health, safety and other societal issues.
PEO4 Implement their exhibiting critical thinking and problem- solving skills in professional practices or tackle
social, technical and business challenges.

5
Program Specific Outcomes

PSO1 Analyze their abilities in systematic planning, developing, testing


and executing complex computing applications in field of Social-Media
and Analytics, Web Application Development and Data Interpretations.
PSO2 Apprise in-depth expertise and sustainable learning that
contributes to multi-disciplinary creativity, permutation, modernization
and study to address global interest.

6
Topic To be Covered

• Introduction(CO2)
• terminology (CO2)
• representation of tree data structure (CO3)
Tree Data Structure
Introduction
• A tree data structure is defined as a collection of objects or entities known as nodes that are
linked together to represent or simulate hierarchy.
• A tree data structure is a non-linear data structure because it does not store in a sequential
manner. It is a hierarchical structure as elements in a Tree are arranged in multiple levels.
• The topmost node in tree is known as a root node.
Basic Terminologies In Tree Data Structure:
Terminology Description Example from Diagram
Node Each vertex of a tree is a node. ‘1’, ‘2’, ‘3’ are the node in the tree.

Root Topmost node of a tree. Node ‘1’ is the topmost root node.

Node ‘2’ is the parent of ‘5’ and ‘6’, and Node ‘3’ is the
Parent Node The node has an edge-sharing to a child node. parent of ‘7’.

Child Node The sub-node of a parent node is the child node. ‘5’ and ‘6’ is the children of ‘2’.

The last node which does have any subnode is the leaf
Leaf or External node node. ‘5’, ‘6’, ‘9’ and ‘8’ are leaf nodes.

The link between ‘1’ and ‘2’, ‘2’ and ‘5’, ‘2’ and ‘6’ are
Edge Connecting link between two nodes.
edges

Siblings Nodes with the same parent are siblings. ‘5’ and ‘6’ are siblings with ‘2’ as their parent.

The height of a tree is the length of the longest path


Height from the root to a leaf node. It is calculated with the The height of ‘1’ is 3. (longest path is 1-3-7-9)
total number of edges.

The number of edges from the root node to that node is


Depth called the Depth of that node. The depth of root node ‘1’ is the height of ‘1’ – 1 = 2
Depth of a tree = Height of tree – 1

Each step from top to bottom is called a Level. If the root


Level node is at level 0, its next child node is at level 1, its ‘1’ or root node is at level 0, ‘2’, ‘3’, and ‘4’ is at level 1,
grandchild is at level 2, and so on. and so on.

Sub-Tree Descendants of a node represent a subtree. Nodes ‘2’, ‘5’, and ‘6’ represent a sub-tree.

The degree of a node represents the total number of


Degree of Node children in it. The degree of ‘2’ is 2 (‘5’ and ‘6’). The degree of ‘4’ is 1.

In a tree data structure, the node which has at least one


Internal Node 1,2,3,4,7
child is called as INTERNAL Node.
Root

• The first node from where the tree originates is called as a root node.
• In any tree, there must be only one root node.
• We can never have multiple root nodes in a tree data structure.
Edge

• The connecting link between any two nodes is called as an edge.


• In a tree with n number of nodes, there are exactly (n-1) number of
edges.
Parents

• The node which has a branch from it to any other node is called as a parent node.
• In other words, the node which has one or more children is called as a parent node.
• In a tree, a parent node can have any number of child nodes.
Child

• The node which is a descendant of some node is called as a child node.


• All the nodes except root node are child nodes.
Siblings

• Nodes which belong to the same parent are called as siblings.


• In other words, nodes with the same parent are sibling nodes.
Leaf /External/ Terminal Nodes

• The node which does not have any child is called as a leaf node.
• Leaf nodes are also called as external nodes or terminal nodes
Internal Nodes / Non Terminal Nodes

• The node which has at least one child is called as an internal node.
• Internal nodes are also called as non-terminal nodes.
• Every non-leaf node is an internal node.
Degree

• Degree of a node is the total number of children of that node.


• Degree of a tree is the highest degree of a node among all the nodes
in the tree.
Level

• In a tree, each step from top to bottom is called as level of a tree.


• The level count starts with 0 and increments by 1 at each level or step.
Height

• Total number of edges that lies on the


longest path from any leaf node to a
particular node is called as height of
that node.
• Height of a tree is the height of root
node.
• Height of all leaf nodes = 0
Depth

• Total number of edges from root node to a


particular node is called as depth of that node.
• Depth of a tree is the total number of edges
from root node to a leaf node in the longest
path.
• Depth of the root node = 0
• The terms “level” and “depth” are used
interchangeably.
Path

• In a tree data structure, the sequence of Nodes and Edges from one node to another node is called
as PATH between that two Nodes. Length of a Path is total number of nodes in that path. In below
example the path A - B - E - J has length 4.
Subtree

• In a tree data structure, each child from a node forms a subtree


recursively. Every child node will form a subtree on its parent node.
Representation of Binary Tree Data
Structure:

struct Node
{
int data;
struct Node *first_child;
struct Node *second_child;
struct Node *third_child;
.
.
.
struct Node *nth_child;
};
Book References
TEXT BOOKS
• Seymour Lipchitz, Schaum's Outlines Series Data Structures TMH. J.P. Hayes,
Computer Organization and Architecture, Third Edition, TMH.
• Data Structure Theory Problem and Algorithms, R.S. Salaria, Khanna Book
Publishing Company, Delhi.
REFERENCE BOOKS
• Introduction to Data Structures Applications, Trembley&Soreson, Second
Edition, Pearson Education Robert L. Britton, MIPS Assembly Language
Programming, Pearson Prentice Hall.
• A. Tanenbaum, Y. Lanhgsam and A. J. Augenstein, Data Structures Using C++,
Prentice Hall of India, 1990
Video Links

https://www.youtube.com/watch?v=YAdLFsTG70w
THANK YOU

Created by: Deepika Dhiman (E15896)


[email protected]

You might also like