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:

    Dust rises from the main road and old Délira is stooping in front of her hut. She doesn’t look up, she softly shakes her head, her headkerchief all askew, letting out a strand of grey hair powdered, it appears, with the same dust pouring through her fingers like a rosary of misery. She repeats, “we will all die”, and she calls on the good Lord.
    Jacques Roumain (1907–1945)

    Who knows what sort of seventeen-year locust will next come out of the ground?
    Henry David Thoreau (1817–1862)