We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
冒泡排序是通过数去找位置,这里的冒泡排序写成选择排序了,附代码
func bubbleSort(arr []int) []int { if len(arr) == 0 { return arr } n := len(arr) for i := 0; i < n-1; i++ { for j := 0; j < n-1-i; j++ { if arr[j] > arr[j+1] { arr[j], arr[j+1] = arr[j+1], arr[j] } } } return arr }
The text was updated successfully, but these errors were encountered:
确实是不正确
Sorry, something went wrong.
No branches or pull requests
冒泡排序是通过数去找位置,这里的冒泡排序写成选择排序了,附代码
The text was updated successfully, but these errors were encountered: