I'm solving the Clone Graph in Leetcode, but I encountered a problem inside the following codes
class Node {
public:
int val;
vector<Node*> neighbors;
Node() {
val = 0;
neighbors = vector<Node*>();
}
Node(int _val) {
val = _val;
neighbors = vector<Node*>();
}
Node(int _val, vector<Node*> _neighbors) {
val = _val;
neighbors = _neighbors;
}
};
what does it mean by the statement neighbors = vector<Node*>();
. More specifically, vector<Node*>()
. Why is it followed by parentheses?