node*n=new node(data);
in this lecture what is the meaning and significance of node*n and *n. please help i am not understanding this statement
node*n=new node(data);
in this lecture what is the meaning and significance of node*n and *n. please help i am not understanding this statement
Node* data type is a pointer to Node data type. so Node* n means n is a pointer variable for data type Node.
new Node(data) means we need to dynamically allocate the memory for a new Node and passing data as an arguement means Node() is a constructor which takes data as a parameter to provide value for that particular node.