package main import ( "fmt" ) func SelectSort(arr *[6]int) { for j := 0; j < len(arr ) - 1; j++ { max := arr[j] maxIndex := j for i := j + 1; i < len(arr); i++ { if max > arr[i] { max = arr[i] maxIndex = i } } if maxIndex != 0 { arr[j], arr[maxIndex] = max, arr[j] } } } func main() { arr := [6]int{13,78,10,45,664,12} SelectSort(&arr) fmt.Println(arr) }