如果根節點在陣列中的位置是1,第n個位置的子節點分別在2n和2n+1。因此,第1個位置的 ... if left ≤ heap_length[A] and A[left] > A[largest] then: largest ← left
確定! 回上一頁