MR> Hi All , hope you are having a nice day
So far, so good! Thanks.
MR> Can someone explain how this sort works I have tried to follow it
MR> but I just get confused.
MR> while(test == 0)
MR> {
MR> test = 1;
MR> for (i = 0; i < (MAX - 1); i++)
MR> {
MR> if (table[i] < table[i + 1])
MR> {
MR> temp = table[i];
MR> table[i] = table[ i + 1];
MR> table[i + 1] = temp;
MR> test = 0;
MR> }
MR> }
MR> }
That's a good one, I didn't think it would work, but it does. Seems to
go through the entire array, moving higher values to the left, setting
test=0 if there was a sort performed, so the while loop gets performed
again on the entire array. Thanks for the loop!
L8r,
bw
... Don't steal. The government hates competition.
--- Blue Wave/DOS v2.20
---------------
* Origin: River Canyon Rd. BBS Chattanooga, Tn (1:362/627)
|