The 4 steps for sorting are not definite. Its just that Goro has to follow the following steps : * Hold down any element that is in its place * Bang table to re-arrange other elements.
Repeat this step till all elements are sorted. As elements get in place, include them into the held down elements. If Goro is lucky, all elements get sorted in a single step. If Goro is unlucky, it can take indefinitely long to sort. On an average, you will see that the above method will get the elements sorted in 4 shots. On 9 May 2011 06:32, WL Teng <[email protected]> wrote: > Could anyone show me what are the four steps in sorting 4 1 2 3? > > Sorry for the repost, if any, because my old post did not show up. > > -- > You received this message because you are subscribed to the Google Groups > "google-codejam" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en. > > -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
