(customList)
| 160 | heapify(customList ,n ,smallest) |
| 161 | |
| 162 | def heapSort(customList): |
| 163 | n = len(customList) |
| 164 | for i in range(int(n/2)-1,-1,-1): |
| 165 | heapify(customList,n,i) |
| 166 | |
| 167 | for i in range(n-1,0,-1): |
| 168 | customList[i],customList[0]=customList[0],customList[i] |
| 169 | heapify(customList,i,0) |
| 170 | customList.reverse() |
| 171 | |
| 172 | |
| 173 |
no test coverage detected