title: Selection Sort on a Singly Linked List
body: <p>As I checked, I find the right minimum value and previous node. After that the only thing I need to do is swapping nodes,however after implementing this code the output is nothing.</p>
  
  <p>After drawing the question I thought the problem is sorted part.So I added one more node which name is sorted but still I couldn't solve my problem.</p>
  
  <p>Here is my example code:</p>
  
  <pre><code>public void selectionSort()
  {            
      Node&lt;T&gt; first = head;
      Node&lt;T&gt; previous = head;
      Node&lt;T&gt; minimum = head;
      Node&lt;T&gt; compare;
      Node&lt;T&gt; temp;
      Node&lt;T&gt; sorted = head;           
      while (first.Next != null)
      {
         sorted = minimum; // with this I'm finding the last sorted node
         minimum = first;
         compare = first.Next;
         while (compare.Next != null)
         {
           if (minimum.Value.CompareTo(compare.Next.Value) &gt; 0)
           {
             previous = compare; // Need previous node to changing connections
             minimum = compare.Next; // Saving minimum value
           }
           compare = compare.Next; 
          }
          // Swapping nodes
          temp = first;
          previous.Next = first;
          first.Next = minimum.Next;
          minimum.Next = temp.Next;
          if ( temp != head)
          {
            sorted.Next = minimum; // Adding minimum node to sorted part
          }
            first = first.Next;
          }            
      }
  </code></pre>