I had a question in a test, which asked me the following question:
Selection sort runs faster than Insertion sort for an array in reverse order.
Now, according to my knowledge, both of them have a time complexity of $O(n^2)$ in case of this particular input arrangement, so comparing the running time of them is not possible because it becomes a question of how the algorithms are implemented. A poorly written selection sort could be much slower than insertion sort and vice versa, so an argument can be made for both cases.
But the answer key says that since selection sort has lesser number of swaps (order of $n$) compared to insertion sort (quadratic comparisons), selection sort should be faster than insertion sort for this particular case.
Which is the correct solution? Can selection sort be faster under certain assumptions?