We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Minimum Swaps 2
- Discussions
Minimum Swaps 2
Minimum Swaps 2
Sort by
recency
|
2460 Discussions
|
Please Login in order to post a comment
Java 7: Uses Selection sort which guarantees minimum number of swaps.
I figure an index map can make it a whole a lot easier and straight forward:
My solution in java:
O(n)