This implementation uses arrays for which heap[k] <= heap[2*k+1] and heap[k] <= heap[2*k+2] for all k, ... If the heap is empty, IndexError is raised.
確定! 回上一頁