Strand sort: Difference between revisions

Content deleted Content added
Heldw (talk | contribs)
Reformatted the article. Changed the example. Updated the code. Altered it a bit to make it more from a neutral point of view.
Heldw (talk | contribs)
m minor text edit in the example
Line 61:
* 2 < 4 so 2 is not added to the sub-list.
 
* 0 < 4 so 20 is not added to the sub-list.
 
* 6 > 4 so 6 is added to the sub-list and is removed from the original list.
Line 75:
* 7 < 8 so 7 is not added to the sub-list.
 
'''Step 11:''' Since there are no more elements in the original list to compare {8} to, the sub-list is merged with the solution list. Now the original list contains {2, 0, 3, 7}, the sub-list is empty and the solution-list contains: {1, 4, 5, 6, 8, 9}.
 
'''Step 12:'''  Move the first element of the original list into sub-list. Sub-list contains {2}
Line 89:
* 7 > 3 so 7 is added to the sub-list and is removed from the original list.
 
'''Step 15:''' Since there are no more elements in the original list to compare {7} to, the sub-list is merged with the solution list. The original list now contains {0}, the sub-list is empty, and solution list contains: {1, 2, 3, 4, 5, 6, 7, 8, 9}.
 
The solution list now contains: {1, 2, 3, 4, 5, 6, 7, 8, 9}.
 
'''Step 16:'''  Move the first element of the original list into sub-list. Sub-list contains {0}.