title: Finding Max/Min values in a linked list
body: <p>When the while loop iterates, it skips both "if" loops and when the "q=q->next" statement runs, both the max and min values are changed as well. Am I not initializing the max/min integers correctly?  </p>
  
  <pre><code>void FindMaxMin(int&amp; max, int&amp; min)
      {
          NODE* q;
          q=List; //to start over
          while(q != NULL)
          {
              max=min=q-&gt;info; //Sets max and min to first value
  
              if(q-&gt;info&gt;max)
                  max=q-&gt;info;
              if(q-&gt;info&lt;min)
                  min=q-&gt;info;
              q=q-&gt;next;
          }
      }
  </code></pre>