I have a TreeNode class with a constructor that sets the value of the node, and sets the left and right pointers to null.
class TreeNode {
public:
int val = 0;
TreeNode *left;
TreeNode *right;
TreeNode(int x) {
this->val = x;
left = right = nullptr;
}
};
When I hover my mouse over TreeNode(int x) I get a message that states:
TreeNode::TreeNode(int x)
+2 overloads
What does 'overloads' mean in this context? From what I understand, overloading would occur if I, for example, had an additional function within the TreeNode class also named TreeNode().
Thanks for any explanation!