Jump to content

Sorting algorithms/Heapsort: Difference between revisions

m
Line 940:
is_sorted (ar: ARRAY [INTEGER]): BOOLEAN
--- Is 'ar' sorted in ascending order?
require
ar_not_empty: ar.is_empty = False
local
i: INTEGER
Line 949 ⟶ 947:
i := ar.lower
until
i >= ar.upper
loop
if ar [i] > ar [i + 1] then
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.