S
sun
I have a tree structure defined as Nodes with parent and children. a
tree class holds traverse function and other functions.
When traversing the tree with its nodes, I 'd pass one of the function
in node, func1() as parameters, is it possible? if so, how to define that?
class Node{
.....
public:
func1();//do sth
}
class Tree{
Node* root;
..
public:
traverse(Node,func1);
}
Thanks!
tree class holds traverse function and other functions.
When traversing the tree with its nodes, I 'd pass one of the function
in node, func1() as parameters, is it possible? if so, how to define that?
class Node{
.....
public:
func1();//do sth
}
class Tree{
Node* root;
..
public:
traverse(Node,func1);
}
Thanks!