We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Advanced
- Java Visitor Pattern
- Discussions
Java Visitor Pattern
Java Visitor Pattern
Sort by
recency
|
199 Discussions
|
Please Login in order to post a comment
class SumInLeavesVisitor extends TreeVis { private int sum = 0;
}
class ProductOfRedNodesVisitor extends TreeVis { private long product = 1; private final int MOD = 1000000007;
}
class FancyVisitor extends TreeVis { private int sumNonLeafEvenDepth = 0; private int sumGreenLeaves = 0;
}
public class Solution { private static int[] values; private static Color[] colors; private static Map> edges = new HashMap<>();
class SumInLeavesVisitor extends TreeVis { private int sum = 0;
}
class ProductOfRedNodesVisitor extends TreeVis { private double product = 1;
}
class FancyVisitor extends TreeVis { private int nonLeafNodeSum = 0; private int greenLeafSum = 0;
}
public class Solution {
what?!?
java solution with the supposed pre-existing classes
I don't get it are this clases provided? or do we have to implement them? abstract class Tree class TreeNode extends Tree class TreeLeaf extends Tree abstract class TreeVis
because the compiler is not able to find the but the text says: "A Tree class implementing a rooted tree is provided in the editor"