title: why do i need to return the head in a linked list?c++
body: <pre><code>NODE* InsertAtHead(NODE* &amp;head, int val){
      NODE *tmp = new NODE;
  
      //create a new node
      if (tmp == NULL)
          exit(1);
  
      //Initialize the new node
      tmp-&gt;data = val;
      tmp-&gt;next = NULL;
  
      //Insert by changing links
      tmp-&gt;next = head;
      head = tmp;         //update head
      return head;
  }
  </code></pre>
  
  <p>Why in the end we need to put return head? </p>