Un Shuffle Sort - Phase I - Distribution Phase

Distribution Phase

  1. Take the first input item and create pile#1 with item#1 as head and tail.
  2. If no more items goto Phase II.
  3. Take next input item.
  4. Select the last pile for comparison.
  5. Compare to top of the pile.
  6. If equal place on top of pile, goto 2.
  7. If less and this pile is not the first pile then select the previous pile for comparison, go to 5.
  8. If less and this pile is the first pile, place item on top of the pile, goto 2.
  9. If greater and this is not the last pile place on top of the next pile (which is the one previously compared), goto 2, else this Item is greater than top of last pile. Continue to 10.
  10. Compare to bottom of the current pile.
  11. If equal place on bottom of pile, goto 2.
  12. If greater and this is not the first pile select the previous pile, goto 10.
  13. If less and this is the last pile create a new pile with the item and append to the list of piles, goto 2.
  14. Place on bottom of the next pile (which is the one previously compared), goto 2.

Read more about this topic:  Un Shuffle Sort, Phase I

Famous quotes containing the words distribution and/or phase:

    My topic for Army reunions ... this summer: How to prepare for war in time of peace. Not by fortifications, by navies, or by standing armies. But by policies which will add to the happiness and the comfort of all our people and which will tend to the distribution of intelligence [and] wealth equally among all. Our strength is a contented and intelligent community.
    Rutherford Birchard Hayes (1822–1893)

    It no longer makes sense to speak of “feeding problems” or “sleep problems” or “negative behavior” is if they were distinct categories, but to speak of “problems of development” and to search for the meaning of feeding and sleep disturbances or behavior disorders in the developmental phase which has produced them.
    Selma H. Fraiberg (20th century)