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 bubbleSortFront(s []int) { // 外层循环,每次循环把最小的值放到第i的位置 for i := 0; i < len(s); i++ { for j := i + 1; j < len(s); j++ { if s[i] > s[j] { s[i], s[j] = s[j], s[i] } else { continue } } } }
func bubbleSortEnd(s []int) { e := len(s) - 1 // 每次排序,把最大值放到第e个的位置 for e >= 0 { f := 0 for f <= e { if s[f] > s[e] { s[e], s[f] = s[f], s[e] } f++ } e-- } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
找工作的时候就过来温习一遍
选择排序
找最小值,然后放到前边
找最大值,然后放到末尾
The text was updated successfully, but these errors were encountered: