void print(node*head){
while(head!=NULL){
here head is already null how it treaverse till end}
When we write while( head 1=NULL ) ----> tell me in function we pass node* head when head is already null then why it not stop in first time in while loop
head always points to the first node of linked list. head can only be null when linked list is empty.
when we call print, we pass head pointer to this function, which is not null, it actually points to first node of linked list.
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.