Query on algorithms


#1

Which of the following is/are True?
(i) An almost complete Binary Tree in a minheap tree if every parent node is minimum compared with its children.
(ii) An almost complete Binary tree is a minheap tree if every parent node is greater than its left child and less than or equal to its right child.
(iii) Heap sort is an inplace sorting technique
(iv) Heap sort is stable.
(a) Only (ii), (iii) & (iv)
(b) Only (i), (iii) & (iv)
© Only (i) & (iii)
(d) Only (ii) & (iv)


#2

Answer is B since heap sort doesn’t take any extra space while computing and doesn’t change the relative order of similar elements while sorting so 3,4 are true and 1 is true.