Sorting algorithms/Merge sort: Difference between revisions

Line 1,448:
 
The following program not only sorts a list of integers, but verifies that the result is sorted. It is the simplest implementation I could think of that does that. It works by having a special kind of list that can be consed only in sorted order.
 
The length of the result also is verified. However, there is no proof that the result contains the same data as the input.
 
<lang ats>//--------------------------------------------------------------------
1,448

edits