-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
快速排序的实现方式有优化空间 #64
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
快速排序的精髓在于“减少swap的次数”,目前的实现代码中,swap次数偏多,不够精简,在GIF动图的演示里也能看出问题。
正确的实现方式可以参考wikipedia,以下是python实现方式的代码:
The text was updated successfully, but these errors were encountered: