Question
In the previous question, what is the effect of calling MaxHeapify(A,i) where i> A.heap-size/2 ? MaxHeapify(A, i) will be executed one time. MaxHeapify(A, i) will
-
In the previous question, what is the effect of calling MaxHeapify(A,i) where i> A.heap-size/2 ?
MaxHeapify(A, i) will be executed one time. MaxHeapify(A, i) will be executed two times. MaxHeapify(A, i) will be executed three times. MaxHeapify(A, i) will not be executed. None of the above
-
What value will be returned by Partition(A, p, r) algorithm when all elements in the array A[pr] has the same value?
Partition(A, p, r){
x = A[r]
i = p -1
for j = p to r -1
if (A[j] <= x)
i= i + 1
exchange A[i] with A[j]
Exchange A[i+1] with A[r];
return i+1;
}
p p+1 r r+1 None of the above
In the previous question, what is the effect of calling MaxHeapify(A,i) where i> A.heap-size/2 ?
MaxHeapify(A, i) will be executed one time. MaxHeapify(A, i) will be executed two times. MaxHeapify(A, i) will be executed three times. MaxHeapify(A, i) will not be executed. None of the above
What value will be returned by Partition(A, p, r) algorithm when all elements in the array A[pr] has the same value?
Partition(A, p, r){
x = A[r]
i = p -1
for j = p to r -1
if (A[j] <= x)
i= i + 1
exchange A[i] with A[j]
Exchange A[i+1] with A[r];
return i+1;
}
p p+1 r r+1 None of the above
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started