What happens if the null path length is not updated?

Category: QuestionsWhat happens if the null path length is not updated?
Editor">Editor Staff asked 4 weeks ago

What happens if the null path length is not updated?
 
(a) error occurs
 
(b) all null path lengths will be 0
 
(c) all null path lengths will be -1
 
(d) all null path lengths will be 1
 
My query is from Heap topic in division Heap of Data Structures & Algorithms I
 
I had been asked this question in an online interview.

1 Answers
Editor">Editor Staff answered 4 weeks ago

Right choice is (b) all null path lengths will be 0
 
Explanation: While performing insertion via merge operation in a leftist heap, if the null path length is not updated, all null path lengths will be 0.