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:

    In this distribution of functions, the scholar is the delegated intellect. In the right state, he is, Man Thinking. In the degenerate state, when the victim of society, he tends to become a mere thinker, or, still worse, the parrot of other men’s thinking.
    Ralph Waldo Emerson (1803–1882)

    This is certainly not the place for a discourse about what festivals are for. Discussions on this theme were plentiful during that phase of preparation and on the whole were fruitless. My experience is that discussion is fruitless. What sets forth and demonstrates is the sight of events in action, is living through these events and understanding them.
    Doris Lessing (b. 1919)