Page 2 of 2

Posted: Wed Jan 28, 2004 6:51 pm
by FAQ
if the elements of array can appear more than once
Example : 333212211
How to solve it ?

Posted: Mon Feb 23, 2004 8:21 pm
by Sayutee
Well, I think a simple "Selection Sort" is Enough to get the minimum swaps (Someone please tell me if I am wrong!)

The Selection Sort will also solve the problem with Repeating numbers.

Posted: Tue Feb 24, 2004 2:57 pm
by junbin
Sayutee wrote:Well, I think a simple "Selection Sort" is Enough to get the minimum swaps (Someone please tell me if I am wrong!)

The Selection Sort will also solve the problem with Repeating numbers.
There's no need to sort.. just count.