Sorting algorithms/Counting sort: Difference between revisions
Content deleted Content added
→{{header|Ruby}}: used concat |
|||
Line 493: | Line 493: | ||
--- Is 'ar' sorted in ascending order? |
--- Is 'ar' sorted in ascending order? |
||
require |
require |
||
ar_not_empty: ar.is_empty = |
ar_not_empty: ar.is_empty = False |
||
local |
local |
||
i: INTEGER |
i: INTEGER |
||
do |
do |
||
Result := |
Result := True |
||
from |
from |
||
i := ar.lower |
i := ar.lower |
||
Line 504: | Line 504: | ||
loop |
loop |
||
if ar [i] > ar [i + 1] then |
if ar [i] > ar [i + 1] then |
||
Result := False |
|||
end |
end |
||
i := i + 1 |
i := i + 1 |
||
Line 511: | Line 511: | ||
end |
end |
||
</lang> |
</lang> |
||
TEST: |
TEST: |