summaryrefslogtreecommitdiff
path: root/sort/sorted.go
blob: a24de190787967e5b568e9aa037c38b3416a0be1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
package sort

import "algorithms/ds"

func Sorted(a []ds.Comparer) bool {
	for i := len(a) - 1; i > 0; i-- {
		if a[i].LowerThan(a[i-1]) {
			return false
		}
	}
	return true
}