varalu 0 Report post Posted November 13, 2007 Construct an expression tree for the expression (a || && (c || d) After constructing the tree convert the tree to correspond to the associative property of the given expression. Eg: (1 + 2) * ( 3 + 4) = (1 * 3) + (1 * 4) + (2 * 3) + (2 * 4) Similar to that, from the constructed expression tree, construct a new expression tree such that inorder traversal of the new tree will be associative value of the given expression Inorder traversal of the new tree should be (a && c) || (a && d) || (b && c) || (b && d) Write a generic algorithm to convert the first tree to the second tree.. What is an Expression Tree?? Visit links below. http://www.brpreiss.com/books/opus5/html/page264.html http://www.cs.jhu.edu/~goodrich/dsa/05trees/Demo1/ Tree Traversals Visit the below links for knowing more about tree traversals. https://en.wikipedia.org/wiki/Tree_traversal http://www.brpreiss.com/books/opus4/html/page260.html Share this post Link to post Share on other sites