Insertion vs Selection I currently have a selection sorting algorithm, but need some help turning it into a insertion sort, I understand a insertion sort if faster?  The hand array is full, and it needs to sort from lowest to highest rank.  

private void sort(PlayingCard[] hand)
    {
        PlayingCard temp;
        for(int i = 0; i &lt; hand.length ; i++) 
        {

           for(int j = i+1; j &lt; hand.length ; j++)
           {
               int compareRank = hand[j].getRank().compareTo(hand[i].getRank());

               if(compareRank &lt; 0){
                   temp = hand[i];
                   hand[i] = hand[j];
                   hand[j] = temp;
               }
           }

        }
    }
Here is a sort that I put together after some research:

private void sort(PlayingCard[] hand)
{
    int i, j;
    PlayingCard temp;    
    for (i = 1; i &lt; hand.length; i++) {
        temp = hand[i];
        j = i;
        while (j &gt; 0 &amp;&amp; hand[j - 1].getRank().compareTo(temp.getRank()) &gt; 0) {
            hand[j] = hand[j - 1];
            j--;
        }        
        hand[j] = temp;
    }
}