Data Structure - CS3301 - Important Questions With Answer - Unit 3 - Trees
Data Structure - CS3301 - Important Questions With Answer - Unit 3 - Trees
Environmental Sciences
Professional English and Sustainability -
Professional English - - II - HS3252 Discrete Mathematics GE3451
I - HS3152 - MA3354
Statistics and Theory of Computation
Matrices and Calculus Numerical Methods - Digital Principles and - CS3452
3rd Semester
4th Semester
- MA3151 MA3251 Computer Organization
1st Semester
2nd Semester
8th Semester
6th Semester
II Year/III Semester
UNIT -3 (TREES)
Prepared By,
CS3301_DS
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes&hl=en_IN
www.BrainKart.com Page 2 of 6
TWO MARKS
1. Define a tree
A tree is a collection of nodes. The collection can be empty; otherwise, a tree
consists of a distinguished node r, called the root, and zero or more nonempty
(sub) trees T1, T2,…,Tk, each of whose roots are connected by a directed edge
from r.
2. Define root
This is the unique node in the tree to which further sub-trees are attached.
B
C
CS3301_DS
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes&hl=en_IN
www.BrainKart.com Page 3 of 6
B C
D E
CS3301_DS
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes&hl=en_IN
www.BrainKart.com Page 4 of 6
The root node is always considered at level zero, then its adjacent children
are supposed to be at level 1 and so on. Here, node A is at level 0, nodes B
and C are at level 1 and nodes D and E are at level 2.
10.Define forest
A tree may be defined as a forest in which only a single node (root) has no
predecessors. Any forest consists of a collection of trees.
11.Define a binary tree
A binary tree is a finite set of nodes which is either empty or consists of a root
and two disjoint binary trees called the left sub-tree and right sub-tree.
12.Define a path in a tree
A path in a tree is a sequence of distinct nodes in which successive nodes are
connected by edges in the tree.
13.Define a full binary tree
A full binary tree is a tree in which all the leaves are on the same level and
every non-leaf node has exactly two children.
14.Define a complete binary tree
A complete binary tree is a tree in which every non-leaf node has exactly two
children not necessarily to be on the same level.
15.State the properties of a binary tree
• The maximum number of nodes on level n of a binary tree is 2n-1, where
n≥1. • The maximum number of nodes in a binary tree of height n is 2n-1,
where n≥1. • For any non-empty tree, nl=nd+1 where nl is the number of leaf
nodes and nd is the number of nodes of degree 2.
16.What is meant by binary tree traversal?
Traversing a binary tree means moving through all the nodes in the binary
tree, visiting each node in the tree only once.
17.What are the different binary tree traversal techniques?
• Preorder traversal • Inorder traversal • Postorder traversal • Levelorder
traversal
18.What are the tasks performed during inorder traversal?
• Traverse the left sub-tree • Process the root node • Traverse the right sub-
tree
19.What are the tasks performed during postorder traversal?
• Traverse the left sub-tree • Traverse the right sub-tree • Process the root
node
20.State the merits of linear representation of binary trees
. • Storage method is easy and can be easily implemented in arrays • When the
location of a parent/child node is known, other one can be determined easily
• It requires static memory allocation so it is easily implemented in all
programming language
CS3301_DS
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes&hl=en_IN
www.BrainKart.com Page 5 of 6
26.Traverse the given tree using Inorder, Preorder and Postorder traversals.
B
C
D E F G
Inorder : D H B E A F C I G J
Preorder: A B D H E C F G I J
Postorder: H D E B F I J G C A
CS3301_DS
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes&hl=en_IN
www.BrainKart.com Page 6 of 6
PART -B
1. Explain the heap tree ADT in detail
2. Identify the types of priority queue. Explain about min heap insertion and
deletion operation
3. Outline Preorder, inorder and postorder traversals on a binary tree with an
algorithm and an example
4. State the binary search tree property and outline the algorithm to search a
binary search tree with an example
CS3301_DS
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes&hl=en_IN
Click on Subject/Paper under Semester to enter.
Professional English Discrete Mathematics Environmental Sciences
Professional English - - II - HS3252 - MA3354 and Sustainability -
I - HS3152 GE3451
Digital Principles and
Statistics and Probability and
Computer Organization
Matrices and Calculus Numerical Methods - Statistics - MA3391
- CS3351
- MA3151 MA3251
3rd Semester
1st Semester
4th Semester
2nd Semester
Deep Learning -
AD3501
Embedded Systems
Data and Information Human Values and
and IoT - CS3691
5th Semester
7th Semester
8th Semester
Open Elective-1
Distributed Computing Open Elective 2
- CS3551 Project Work /
Elective-3
Open Elective 3 Intership
Big Data Analytics - Elective-4
CCS334 Open Elective 4
Elective-5
Elective 1 Management Elective
Elective-6
Elective 2
All Computer Engg Subjects - [ B.E., M.E., ] (Click on Subjects to enter)
Programming in C Computer Networks Operating Systems
Programming and Data Programming and Data Problem Solving and Python
Structures I Structure II Programming
Database Management Systems Computer Architecture Analog and Digital
Communication
Design and Analysis of Microprocessors and Object Oriented Analysis
Algorithms Microcontrollers and Design
Software Engineering Discrete Mathematics Internet Programming
Theory of Computation Computer Graphics Distributed Systems
Mobile Computing Compiler Design Digital Signal Processing
Artificial Intelligence Software Testing Grid and Cloud Computing
Data Ware Housing and Data Cryptography and Resource Management
Mining Network Security Techniques
Service Oriented Architecture Embedded and Real Time Multi - Core Architectures
Systems and Programming
Probability and Queueing Theory Physics for Information Transforms and Partial
Science Differential Equations
Technical English Engineering Physics Engineering Chemistry
Engineering Graphics Total Quality Professional Ethics in
Management Engineering
Basic Electrical and Electronics Problem Solving and Environmental Science and
and Measurement Engineering Python Programming Engineering
Click on Subject/Paper under Semester to enter.
Environmental Sciences
Professional English and Sustainability -
Professional English - - II - HS3252 Discrete Mathematics GE3451
I - HS3152 - MA3354
Statistics and Theory of Computation
Matrices and Calculus Numerical Methods - Digital Principles and - CS3452
3rd Semester
4th Semester
- MA3151 MA3251 Computer Organization
1st Semester
2nd Semester
8th Semester
6th Semester
4th Semester
- MA3151 MA3251 Computer Organization
1st Semester
2nd Semester
Computer Networks -
CS3591
Object Oriented
Full Stack Web Software Engineering - Human Values and
5th Semester
8th Semester
6th Semester
Elective 1 Elective-5
Management Elective
Elective-6
Elective 2
All Computer Engg Subjects - [ B.E., M.E., ] (Click on Subjects to enter)
Programming in C Computer Networks Operating Systems
Programming and Data Programming and Data Problem Solving and Python
Structures I Structure II Programming
Database Management Systems Computer Architecture Analog and Digital
Communication
Design and Analysis of Microprocessors and Object Oriented Analysis
Algorithms Microcontrollers and Design
Software Engineering Discrete Mathematics Internet Programming
Theory of Computation Computer Graphics Distributed Systems
Mobile Computing Compiler Design Digital Signal Processing
Artificial Intelligence Software Testing Grid and Cloud Computing
Data Ware Housing and Data Cryptography and Resource Management
Mining Network Security Techniques
Service Oriented Architecture Embedded and Real Time Multi - Core Architectures
Systems and Programming
Probability and Queueing Theory Physics for Information Transforms and Partial
Science Differential Equations
Technical English Engineering Physics Engineering Chemistry
Engineering Graphics Total Quality Professional Ethics in
Management Engineering
Basic Electrical and Electronics Problem Solving and Environmental Science and
and Measurement Engineering Python Programming Engineering