title: How to execute a Selection Sort on a linked list?
body: <p>I am trying to implement a selection sort on linked list. I want it to be performed directly on the linked list, not a copy, using node pointers instead of the array index method that I have pasted here:</p>
  
  <pre><code>void listClass::selectionsort(int array[], int size)
  {
      int startscan, minIndex, minValue;
  
  for (startscan = 0; startscan &lt; (size - 1); startscan++) 
  {
      minIndex = startscan;
      minValue = array[startscan];
      for (int index = startscan + 1; index &lt; size; index++) 
      {
          if (array[index] &lt; minValue)
          {
              minValue = array[index];
              minIndex = index;
          }
      }
      array[minIndex] = array[startscan];
      array[startscan] = minValue;
  }
  }
  </code></pre>
  
  <p>How would I tweak this function to accept my linked list? and sort it? I also don't want to use any sort of STL container.</p>