OC 冒泡排序 -- 核心代码

 //冒泡 核心代码

        for (int i = 0; i < array.count - 1; i++) {

            int a = [array[i] intValue];

            for (int j = i + 1; j < array.count; j++) {

                int b = [array[j]  intValue];

                if (a > b) {

                    [array exchangeObjectAtIndex:i withObjectAtIndex:j];

                }

            }

        }

原文地址:https://www.cnblogs.com/iOS-mt/p/4330804.html