Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

  1. 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

  2. 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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions