1.

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 nodesThis key question is from Trees in portion Trees of Data Structures & Algorithms II had been asked this question in my homework.

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.



Discussion

No Comment Found

Related InterviewSolutions