今天爱分享给大家带来IOS开发算法 进入排序 【附代码】,希望能够帮助到大家。
- (void)insertSortArray:(N爆缸utableArray *)array {
for (int i = 1; i < [array count]; i++) {
int j = i;
NSInteger temp = [[array objectAtIndex:i] integerValue];
while (j > 0 && temp < [[array objectAtIndex:j - 1] integerValue]) {
[array replaceObjectAtIndex:j withObject:[array objectAtIndex:(j - 1)]];
j--;
}
[array replaceObjectAtIndex:j withObject:[NSNumber numberWithInteger:temp]];
}
}
原文链接:https://blog.itblood.com/596.html,转载请注明出处。

![NTR手机 V0.30 官方中文版 [PC+安卓] [更新] [670M] [SLG/中文/NTR]](/wp-content/uploads/replace/2025/09/22/f3e1094e21bf82b8af6fcae996623d09.webp)