Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimum swaps required to sort an array #2

Open
y4h2 opened this issue Oct 31, 2022 · 0 comments
Open

minimum swaps required to sort an array #2

y4h2 opened this issue Oct 31, 2022 · 0 comments

Comments

@y4h2
Copy link
Owner

y4h2 commented Oct 31, 2022

这里的swap不限于相邻元素间的swap。
所以应该找到互相成为循环的元素组
Minimum number of swaps required to sort an array

而对于相邻元素间的swap则可以通过逆序对来求出

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant