@11:12 node *n = new node(); n->next = head; head = n;

@11:12 node *n = new node();
n->next = head;
head = n;

not get n->next = head ;
head = n; ???

Hello @amit0001 in this we are adding nodes at the head.
Suppose we have declared the new node and after that we are adding the original list to the next of the new node and then declaring the new node formed as head.

still not getting

not get n->next = head ;
head = n; ???

n next mai head ka address kaise store kiya hai new head toh bna hi nhi hai na ?

Check this
https://drive.google.com/file/d/1WnbJlKkRzk6rYhWpVcXPzCYKfHqQCcZ1/view?usp=drivesdk

1 Like

thanks

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.