Sorting Almost Ordered Arrays

Caxton C. Foster · The Computer Journal · 1968

This paper presents an algorithm for sorting a collection of items that are already almost sorted. It is assumed that each item has a sorting key associated with it and that it is desired to arrange the items so that their keys are in ascending order. If duplicate keys are encountered only the item associated with the ‘latest’ occurrence of the duplicated key is preserved, earlier occurrences being discarded. The need for such an algorithm is most obvious in the case of on-line record editing in a time-sharing environment where most of the records or sentences will have been entered correctly, but occasionally there will be a replacement of an old record or the insertion of new ones into already entered text. This algorithm first constructs a table with one entry in the table for each part of the source text that is internally ordered. It then performs an N-way merge of the parts.

Read the paper · More papers on PaperTik