标签:
- (void)bubbleSort:(NSMutableArray *)array
{
int i, y;
BOOL bFinish = YES;
for (i = 1; i<= [array count] && bFinish; i++)
{
bFinish = NO;
for (y = (int)[array count]-1; y>=i; y--)
{
if ([[array objectAtIndex:y] intValue] < [[array objectAtIndex:y-1] intValue])
{
[array exchangeObjectAtIndex:y-1 withObjectAtIndex:y];
bFinish = YES;
}
}
}
}
标签:
原文地址:http://www.cnblogs.com/littlepony/p/5834193.html