Here we are writing :
void insertAtHead(node* head, int d)
so here if we are writing node* head that means head is a pointer of type node* which will point to the head. So it is already storing the address of head then why we are saying that it is pass by value and not pass by reference.
And for passing it by reference we write:
void insertAtHead(node* &head, int d)
Why ?