首页 > TAG信息列表 > swapcnt

手写快排,解决栈溢出写法,Golang

package main import "fmt" var swapcnt int func main() { arr := []int{2, 3, 4, 5, 1} //idx := Swap(arr, 0, len(arr)) //fmt.Println(idx, arr) myquickSort(arr, 0, len(arr)-1) fmt.Println(arr) fmt.Println(swapcnt) } func Swap(arr []int, l,