title: Keep statistic about sorting algorithms
body: <p>I have a homework about object oriented programming in c#. a part of my homework, I need to make 2 different sorting algorithms and putting the random numbers into them and observing statistic about 2 different algorithms. 
  about that my teaches said me in e-mail "<em>Non static sorting class can keep statistic about sorting how many numbers, how fast, min, max, average..</em>"</p>
  
  <p>So there are my sorting algorithms which Insertion and Count Sortings. Please tell me how can i keep statistic about sorting.</p>
  
  <p>Don't forget main subject of my homework is OOP.</p>
  
  <pre><code>class InsertionSorting : Sort    
  {
      public override List&lt;int&gt; Sorting(List&lt;int&gt; SortList)
      {
  
          for ( int i=0; i&lt;SortList.Count-1; i++)
          {
              for (int j= i+1; j&gt;0; j--)
              {
                  if (SortList[j-1] &gt; SortList [j])
                  {
                      int temp = SortList[j - 1];
                      SortList[j - 1] = SortList[j];
                      SortList[j] = temp;
                  }
              }                                
          }
          return SortList;
      }
  }
  
  
  
  class CountSorting : Sort
  {
      public override List&lt;int&gt; Sorting(List&lt;int&gt; SortList)
      {
          int n = SortList.Count;
          List&lt;int&gt; output = new List&lt;int&gt;();
          List&lt;int&gt; count = new List&lt;int&gt;();
  
          for (int i = 0; i &lt; 1000; ++i)
          {
              count.Add(0);
              output.Add(0);                
          }
  
          for (int i = 0; i &lt; n; ++i)
              ++count[SortList[i]];
  
          for (int i = 1; i &lt;= 999; ++i)
              count[i] += count[i - 1];
  
          for (int i = 0; i &lt; n; ++i)
          {
              output[count[SortList[i]] - 1] = SortList[i];
              --count[SortList[i]];
          }
  
          for (int i = 0; i &lt; SortList.Count; i++)
              SortList[i] = output[i];
  
          return SortList;
      }
  }
  </code></pre>