The document discusses the New-order strategy for traversing binary trees, which involves visiting the root node, then the right subtree using New-order, then the left subtree using New-order. It then asks which option represents the New-order traversal of an expression tree corresponding to the reverse polish notation 3 4 * 5 - 2 ˆ 6 7 * 1 + -. The correct answer is (c) - + 1 * 7 6 ˆ 2 - 5 * 4 3.
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Ds gate tree ppt
1. Answer the question
• Consider the following rooted tree with the vertex P
labeled as The order in which the nodes are visited
during in-order traversal is
•
(A) SQPTRWUV
(B) SQPTURWV
(C) SQPTWUVR
(D) SQPTRUWV
Walchand Institute of Technology, Solapur 1
2. Answer the question
• Consider the following rooted tree with the vertex P
labeled as The order in which the nodes are visited
during in-order traversal is
•
(A) SQPTRWUV
(B) SQPTURWV
(C) SQPTWUVR
(D) SQPTRUWV
Walchand Institute of Technology, Solapur 2
3. GATE question
Consider the following New-order strategy for traversing a binary tree: Visit the
root; Visit the right sub tree using New-order; Visit the left sub tree using New-
order; The New-order traversal of the expression tree corresponding to the reverse
polish expression 3 4 * 5 - 2 ˆ 6 7 * 1 + - is given by: (GATE CS 2016 )
(a) + – 1 6 7 * 2 ˆ 5 – 3 4 *
(b) – + 1 * 6 7 ˆ 2 – 5 * 3 4
(c) – + 1 * 7 6 ˆ 2 – 5 * 4 3
(d) 1 7 6 * + 2 5 4 3 * – ˆ –
Walchand Institute of Technology, Solapur 3
4. GATE question
New-order strategy for traversing a binary tree:
• Visit the root; Root
• Visit the right sub tree using New-order; R
• Visit the left sub tree using New-order; L
• (Root, R,L)
The New-order traversal of the expression tree corresponding to the reverse
polish expression 3 4 * 5 - 2 ˆ 6 7 * 1 + -
Walchand Institute of Technology, Solapur 4
5. GATE question
3 4 * 5 - 2 ˆ 6 7 * 1 + -
L R Root
Walchand Institute of Technology, Solapur 5
6. GATE question
3 4 * 5 - 2 ˆ 6 7 * 1 + -
L R Root
Walchand Institute of Technology, Solapur 6
7. GATE question
34* 5 - 2 ˆ 6 7 * 1 + -
L R Root
Walchand Institute of Technology, Solapur 7
8. GATE question
34*5- 2 ˆ 6 7 * 1 + -
L R Root
Walchand Institute of Technology, Solapur 8