532 views

Please log in or register to answer this question.

Position:
Show:

Related questions

0 0 votes
0 0 answers
409
409 views
akash.dinkar12 asked Jun 27, 2019
409 views
Why do we bother setting the key of the inserted node to $-\infty$ in line $2$ of MAX-HEAP-INSERT when the next thing we do is increase its key to the desired value?
0 0 votes
0 0 answers
419
419 views
akash.dinkar12 asked Jun 27, 2019
419 views
HEAP-INCREASE-KEY(A,i,key) 1 if key < A[i] 2 error “new key is smaller than current key” 3 A[i] = key 4 while i 1 and A[parent(i)] < A[i] 5 exchange A[i] with A[parent(i...
0 0 votes
0 0 answers
473
473 views
akash.dinkar12 asked Jun 27, 2019
473 views
Give an $O(n\lg\ k)$- time algorithm to merge $k$ sorted lists into one sorted list, where $n$ is the total number of elements in all the input lists. (Hint: Use a minhea...
0 0 votes
1 1 answer
757
757 views
akash.dinkar12 asked Jun 27, 2019
757 views
The operation HEAP-DELETE$(A, i)$ deletes the item in node $i$ from heap $A$. Give an implementation of HEAP-DELETE that runs in $O(lg\ n)$ time for an $n-$element max-h...