while(child < len){ //判断左右孩子谁最大,前提 必须有右孩子 if (child+1 < len&& elem[child] < elem[child+1]){ child++;//此时保留了最大值下标 } if (elem[child] > elem[parent]){ swap(elem,child,parent); parent = child; child = 2*parent+1; }else { break; } } } private ...