(arr []T)
| 9 | import "github.com/TheAlgorithms/Go/constraints" |
| 10 | |
| 11 | func Exchange[T constraints.Ordered](arr []T) []T { |
| 12 | for i := 0; i < len(arr)-1; i++ { |
| 13 | for j := i + 1; j < len(arr); j++ { |
| 14 | if arr[i] > arr[j] { |
| 15 | arr[i], arr[j] = arr[j], arr[i] |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | return arr |
| 21 | } |
nothing calls this directly
no outgoing calls
no test coverage detected