Insertion Sort.
As the size is small, we can neglect time complexity. Now we have to judge these algorithms based on the number of swaps and the number of comparisons.
|
Number of Swaps |
Number of Comparisons |
Insertion Sort
|
O(n) [Worst Case] |
O(n^2) [Worst Case] |
Selection Sort
|
O(n) [Every Case] |
O(n^2) [Every Case] |
Bubble Sort
|
O(n^2) [Every Case] |
O(n^2) [Every Case] |
In best case number of comparisons performed by Insertion Sort is O(n)