?

Log in

Previous Entry | Next Entry

Comments

( 2 comments — Leave a comment )
ravenblack
Apr. 14th, 2011 12:50 am (UTC)
Bah, I wanted to see a quicksort dance but the page even explicitly says it's probably not going to happen.

Also, only the bubble sort dance was really good.

I think the next two after that really needed a couple of balls involved in the dance. As it is, there's no indicator of who should be dancing next. In the case of the insert-sort, the first guy should start with two balls, one black one white. The person holding both balls dances with the person to their right (from our PoV). If he is larger-number, he hands the white ball to the other person and they swaps places. If he is smaller-number, he hands both balls to the other person.

The person holding the white ball dances with the person to their left. If the person with the ball is smaller, they swap places. If the person with the ball is larger, they throw the ball to the person with the black ball.

If the person with both balls has nobody to their right, the dance is complete.

And that's the whole algorithm. Without the balls, their insertion sort is "people dance back along the path and then we go back to the other guy who somehow knows it is time for him to continue". I want pointers in my algorithm dances damn it!
bkleber
Apr. 14th, 2011 05:26 am (UTC)
Hee. Much fun. Thanks for sharing :-)
( 2 comments — Leave a comment )

Profile

Owl Side
jalenstrix
Jalen Strix

Latest Month

May 2011
S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Tags

Powered by LiveJournal.com
Designed by Ideacodes