From: Michael Campbell Date: 2003-09-18T02:19:17+09:00 Subject: Bubble sort and rand() > I don't know if bubble sort using a random number for comparisons is > always a good idea. Bubble sort runs over the array and compares two > subsequent values and swaps them if they are out of order. > It keeps doing that until there are no more swaps during a run. No, that's an optimization to end early if there *ARE* no swaps. The sort still just runs through the list a maximum n (or n-1) times. (Or at least there's no reason NOT to.) __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com