In class Node:
class Node {
public:
int data;
int numchild;
Node** nodelist;
Node(int data, int s);
};
I want an array of pointers (nodelist) to other nodes, which have edges from this node.
Is the following way of constructing such an array (and the above way of declaring it) a correct and the best (or easiest) way possible? If not, why and whats the best way?
Node::Node(int d, int s) {
data = d;
numchild = s;
nodelist = new Node*[s];
}
std::vector<Node*>.