Sorting algorithms/Insertion sort: Difference between revisions
Sorting algorithms/Insertion sort (view source)
Revision as of 08:54, 12 September 2021
, 2 years ago→{{header|AppleScript}}: Minor relabelling.
m (→{{header|AppleScript}}: Minor relabelling.) |
|||
Line 487:
-- put back into the list until either it's superseded or the end of the sort is reached.
set highestSoFar to o's lst's item l
set
if (highestSoFar >
set o's lst's item l to
else
set highestSoFar to
end if
-- Work through the rest of the range, rotating values back into the sorted group as necessary.
repeat with
set
if (highestSoFar >
repeat with
set
if (
set o's lst's item (
else
set
exit repeat
end if
end repeat
set o's lst's item
else
set o's lst's item (
set highestSoFar to
end if
end repeat
|