/* 建议先看堆调整方法,堆调整了解了,整个排序算法就算掌握了 */ - (void)viewDidLoad { [super viewDidLoad]; /* 测试数据 */ NSArray *array=@[@,@,@,@,@,@,@,@,@]; NSMutableArray *mutable=[NSMutableArray arrayWithArray:array]; mutable=[self createMaxHeap:mutable]; NSInteger num=mutable.c…