package main
import "fmt"
func Parrten(list []int,l,r int)int{
base := r
for l < r{
for(l<=r && list[l]<list[base]){l++}
for(l<r && list[r]>list[base]){r--}
list[l],list[base] = list[base],list[l]
}
return l
}
func QuickSort(list []int,l int,r int){
if l < r {
mid := Parrten(list,l,r)
//fmt.Println(mid)
QuickSort(list, l, mid-1)
QuickSort(list, mid+1, r)
}
}
func main(){
list := []int{5, 6, 4, 3, 7,99,33,8}
QuickSort(list,0,len(list)-1)
fmt.Println(list)
}