title: How can I find the largest item in a linked list recursively given the head node?
body: <pre><code>int findLargest (ListNode *p)
  // --------------------------------------------------------------------------
  // Preconditions: list head pointer is passed as a parameter.
  // Postconditions: returns the largest value in the linked list.
  // --------------------------------------------------------------------------
  {
      if (p-&gt;item != NULL)
      {
          int largest = p-&gt;item;
          if (largest &gt; p-&gt;next-&gt;item)
              ...
      }
  
      ...
  }
  </code></pre>
  
  <p>Is it possible to write this recursive function passing only a pointer as a parameter?  I can't figure out how to do this without adding more parameters.  Any ideas?  I am only using sequential search.  Nothing fancy.</p>
  
  <p>Here is the portion of class List that will be needed:</p>
  
  <pre><code>    struct ListNode 
      {
          ListItemType item;  // A data item on the list.
          ListNode    *next;  // Pointer to next node
      }; // end ListNode
  
      ListNode   *head; // Pointer to linked list of items.
  </code></pre>
  
  <p>I am mainly worried about the <strong>feasibility</strong> of the problem.  Can this be done with only a pointer as a parameter?</p>