0
One of the most important operations in Binary Trees is the path or crossing. In this operation one node at a time is visited. However, there are different path algorithms.
Consider that a class called Nodetree is already implemented in the Java language and therefore an object of this class called Node is instantiated, which will contain the value attributes, left child address, and right child address. In addition, getValue(), getFilhoEsquerdo() and getFilhoDireito() methods are already implemented and return, respectively, the value of the object saved in the node, the address of the left child node and the address of the right child node.
Thus, the algorithm of a recursive method below, implemented in the Java language, which path operation in a Binary Tree corresponds to?
public Static void route(Nodetree Node) {
if (node != null) {
System.out.print(node.getValue() + " ");
percurso(node.getFilhoEsquerdo());
percurso(node.getFilhoDireito());
}
}
A) Preorder.
B) In order.
C) Post-order.
D) At the level.
AND) Subtree.