Question: What is the following code providing? while ( isInternal ( p ) ) { if ( isExternal ( p . leftChild ( ) ) )

What is the following code providing?
while (isInternal(p)){
if (isExternal(p.leftChild()))break;
if (isExternal(p.rightChild()))
c = p.leftChild();
else if (p.leftChild().element().compareTo(p.rightChild().element())>=0)
c =p.leftChild();
else
c = p.rightChild();
if (c.element().compareTo(p.element())<=0) break;
swapElements(p,c);
p=c;
}
a.
Down Heap Bubbling in Priority Queue insert
b.
Down Heap Bubbling in Priority Queue remove
c.
Up Heap Bubbling in Priority Queue remove
d.
Up Heap Bubbling in Priority Queue insert

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!