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:

    Ink runs from the corners of my mouth.
    There is no happiness like mine.
    I have been eating poetry.
    —Mark Strand (b. 1934)

    The true Chameleon is small,
    A lizard sort of thing;
    He hasn’t any ears at all,
    And not a single wing.
    If there is nothing on the tree,
    ‘Tis the Chameleon you see.
    Carolyn Wells (1862–1942)