title: Valid selection sort algorithm?
body: <p>I've written the following method that uses selection sort to sort an array:</p>
  <pre><code>public T[] selection(T[] arr)
  {
     T temp, min;
     for(int i = 0; i &lt; arr.length-1; i++)
     {
        for(int j = i + 1; j &lt; arr.length; j++)
        {
           min = arr[i];
           if(min.compareTo(arr[j]) &gt; 0)
           {
              temp = arr[i];
              arr[i] = arr[j];
              arr[j] = temp;
           }
        }
     return arr;
  }
  </code></pre>
  <p>However, I am having trouble distinguishing my algorithm from a bubble sort. Does my sorting method pass for a selection sort method?</p>