MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / isSorted

Function isSorted

sort/bogosort.go:16–24  ·  view source on GitHub ↗
(arr []T)

Source from the content-addressed store, hash-verified

14)
15
16func isSorted[T constraints.Number](arr []T) bool {
17 for i := 0; i < len(arr)-1; i++ {
18 if arr[i] > arr[i+1] {
19 return false
20 }
21 }
22
23 return true
24}
25
26func shuffle[T constraints.Number](arr []T) {
27 for i := range arr {

Callers 1

BogoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected