You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pure function isSorted returns true if and only an array is sorted ascendingly.
When I test it with all binary arrays of length 4, isSorted(a) or !isSorted(a) can be asserted, except for the following non-sorted arrays:
The pure function
isSorted
returnstrue
if and only an array is sorted ascendingly.When I test it with all binary arrays of length 4,
isSorted(a)
or!isSorted(a)
can be asserted, except for the following non-sorted arrays:I find this behaviour confusing: why can I assert that
[4]int{1, 1, 1, 0}
is not sorted but the assertion might fail for[4]int{0, 0, 1, 0}
.Program:
The text was updated successfully, but these errors were encountered: