Use of constructor

i am not able to understand why we use constructor here … bhaiya told once but i am not able to find that video

class node{
public:
int data;
nodeleft;
node
right;

    node(int d){
        data = d;
        left = NULL;
        right = NULL;
    }

};

@kushal1998 Whenever you create a node for a linked list, you need to initialize its values. This is why constructor is used.