Algorithms
October 13, 2023Database-Management-System
October 13, 2023Algorithms
Question 38 |
Consider the following rooted tree with the vertex labeled P as t he root:
The order in which the nodes are visited during in-order traversal is
SQPTRWUV | |
SQPTUWRV | |
SQPTWUVR | |
SQPTRUWV |
Question 38 Explanation:
The tree can be redrawn as
Inorder Traversal: Left, Root, Middle, Right.
So, during inorder traversal whenever we visit the node second time then print it.
So, output will be,
S Q P T R W U V
Inorder Traversal: Left, Root, Middle, Right.
So, during inorder traversal whenever we visit the node second time then print it.
So, output will be,
S Q P T R W U V
Correct Answer: A
Question 38 Explanation:
The tree can be redrawn as
Inorder Traversal: Left, Root, Middle, Right.
So, during inorder traversal whenever we visit the node second time then print it.
So, output will be,
S Q P T R W U V
Inorder Traversal: Left, Root, Middle, Right.
So, during inorder traversal whenever we visit the node second time then print it.
So, output will be,
S Q P T R W U V
Subscribe
Login
0 Comments