Heaps - Study Mode

[#91] Given the code, choose the correct option that is consistent with the code. (Here A is the heap) build(A,i)
left-> 2*i
right->2*i +1
temp- > i
if(left<= heap_length[A] ans A[left] >A[temp])
temp -> left
if (right = heap_length[A] and A[right] > A[temp])
temp->right
if temp!= i
swap(A[i],A[temp])
build(A,temp)
Correct Answer

(A) It is the build function of max heap

[#92] Should leaves in ternary heap be distributed from left to right.
Correct Answer

(A) True

[#93] If we implement heap as min-heap, deleting root node (value 1)from the heap. What would be the value of root node after second iteration if leaf node (value 100) is chosen to replace the root at start.
Correct Answer

(A) 2

[#94] Heap exhibits the property of a binary tree?
Correct Answer

(A) True

[#95] Pointer manipulation is generally more time-consuming than multiplication and division.
Correct Answer

(A) true