You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have written the function d-ARY-CHILD(i, j) in par. a, in par.c you are using d-ARY-CHILD(k, i), which is not correct. It should be d-ARY-CHILD(i, k). Moreover, I find no sense in using two if-clauses : if d-ARY-CHILD(k, i) ≤ A.heap-size and A[d-ARY-CHILD(k, i)] > A[i] ;
if A[d-ARY-CHILD(k, i)] > A[largest]. if d-ARY-CHILD(k, i) ≤ A.heap-size and A[d-ARY-CHILD(i,k)] > A[largest] will be enough.
The text was updated successfully, but these errors were encountered:
For (b), I think you're right. Since $\Theta(\log_d n)$ is also correct, I'll leave it as it is for now.
For (c), Updated the if-clause in the pseudocode.
You have written the function d-ARY-CHILD(i, j) in par. a, in par.c you are using d-ARY-CHILD(k, i), which is not correct. It should be d-ARY-CHILD(i, k). Moreover, I find no sense in using two if-clauses : if d-ARY-CHILD(k, i) ≤ A.heap-size and A[d-ARY-CHILD(k, i)] > A[i] ;
if A[d-ARY-CHILD(k, i)] > A[largest]. if d-ARY-CHILD(k, i) ≤ A.heap-size and A[d-ARY-CHILD(i,k)] > A[largest] will be enough.
The text was updated successfully, but these errors were encountered: