when is selection sort better than insertion sort
Selection sort Simple calculation shows that insertion sort will therefore usually perform about half as many comparisons as selection sort, although it can perform just as many or far fewer depending on the order the array was in prior to sorting. It can be seen as an advantage for some real-time applications that selection sort will perform identically regardless of the order of the array, while insertion sort's running time can vary considerably. However, this is more often an advantage for insertion sort in that it runs much more efficiently if the array is already sorted or "close to sorted."
I before E except after C "I before E, except after C" is a mnemonic rule of thumb for English spelling. If one is unsure whether a word is spelled with the sequence ei or ie, the rhyme suggests that the correct order is ie unless the preceding letter is c, in which case it is ei. For example: