Given the BinaryTreeTraversal building expression tree for (…
Given the BinaryTreeTraversal building expression tree for (2 * (a – 1)) + (3 * b), what does preorder(tree.root) print (space-separated)?// snippet from BinaryTreeTraversal.java Node plus = tree.addRoot(“+”); Node mult1 = tree.addLeft(plus, “*”); Node mult2 = tree.addRight(plus, “*”); tree.addLeft(mult1, “2”); Node minus = tree.addRight(mult1, “-“); tree.addLeft(minus, “a”); tree.addRight(minus, “1”); tree.addLeft(mult2, “3”); tree.addRight(mult2, “b”); // call: tree.preorder(tree.root);
Read Details