title: simple insertion sort on a singly linked list c++
body: <p>For now, Im not worried about efficiency and I am just learning. I was wondering if anyone could help me out with learning a simple insertion sort for a singly linked list. This is for my homework so I would like to understand it. Here is the code:</p>
  
  <pre><code>char c[13];
      r &gt;&gt; c;
      r &gt;&gt; NumberOfInts;
  
      Node *node = new Node;
      head = node; //start of linked list
  
      for(int i = 0; i &lt; NumberOfInts; i++) //this reads from the file and works
      {
          r &gt;&gt; node-&gt;data;
          cout &lt;&lt; node-&gt;data &lt;&lt; endl;
          node -&gt;next = new Node; //creates a new node
          node = node-&gt;next;
  
          if(_sortRead) //true
          {
              for(int k = 0; k &lt; i; k++)
              {
                           //insertion sort
              }
          }
      }
  </code></pre>
  
  <p>so far I have it read into an istream so I need to sort it as it gets read in. Node is a struct btw. Could anyone help me please?</p>