Strand Sort

Strand sort is a sorting algorithm. It works by repeatedly pulling sorted sublists out of the list to be sorted and merging them with a result array. Each iteration through the unsorted list pulls out a series of elements which were already sorted, and merges those series together.

The name of the algorithm comes from the "strands" of sorted data within the unsorted list which are removed one at a time. It is a comparison sort due to its use of comparisons when removing strands and when merging them into the sorted array.

The strand sort algorithm is O(n2) in the average case. In the best case (a list which is already sorted) the algorithm is linear, or O(n). In the worst case (a list which is sorted in reverse order) the algorithm is O(n2).

Strand sort is most useful for data which is stored in a linked list, due to the frequent insertions and removals of data. Using another data structure, such as an array, would greatly increase the running time and complexity of the algorithm due to lengthy insertions and deletions. Strand sort is also useful for data which already has large amounts of sorted data, because such data can be removed in a single strand.

Read more about Strand Sort:  Example, Algorithm

Famous quotes containing the words strand and/or sort:

    The annals of this voracious beach! who could write them, unless it were a shipwrecked sailor? How many who have seen it have seen it only in the midst of danger and distress, the last strip of earth which their mortal eyes beheld. Think of the amount of suffering which a single strand had witnessed! The ancients would have represented it as a sea-monster with open jaws, more terrible than Scylla and Charybdis.
    Henry David Thoreau (1817–1862)

    The high-water mark, so to speak, of Socialist literature is W.H. Auden, a sort of gutless Kipling.
    George Orwell (1903–1950)