+1 vote
in Data Structures & Algorithms I by (88.2k points)
In an expression tree algorithm, what happens when an operand is encountered?

(a) create one node pointing to a stack

(b) pop the nodes from the stack

(c) clear stack

(d) merge all the nodes

This key question is from Trees in portion Trees of Data Structures & Algorithms I

I had been asked this question in my homework.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
Correct choice is (a) create one node pointing to a stack

For explanation: When an operand is encountered, create one node trees and push it on to the stack. When an operator is encountered, pop the pointers from last two trees from the stack.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...