I have a function in a tree class :
class Tree {
Node root;
int countDivisibleBy(int divisor) {
}
}
How can i search through the tree and divide every value with the given divisor and in the end return the amount of numbers which can be divided by the divisor?
Node looks like this:
class Node {
int value;
Node left;
Node right;
Node (int value) {
this.value = value;
}
}