title: Returning last node in linked list recursively
body: <p>I'm trying to write function that returns the last node of a linked list recursively withour declaring any local variables. Is this right?</p>
  
  <pre><code>ListNode* lastPtr(ListNode* list){
  If(list = NULL)
  Return NULL;
  Else 
  List = lastPtr(list-&gt;next);
  If(list-&gt;next = NULL)
  Return list;
  }
  </code></pre>
  
  <p>language is c++</p>