My head element is not updated properly , please check

@lakshit hey use double pointer in place of refernce here is pseudo code for eg.
void push(struct Node** head_ref, int new_data)
{
/* allocate node /
struct Node
new_node = new Node;

/* put in the data  */
new_node->data  = new_data; 

/* link the old list off the new node */
new_node->next = (*head_ref); 

/* move the head to point to the new node */
(*head_ref)    = new_node; 

}

i didnt get this pseudocode

@lakshit hi,pseudo code me mene bs example dia hai kisi function ,apko apne functiom ko aise implement krna hai jaise isme double pointer ke through head ko le rkha hai waise hi.

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.