In a leftist heap, the null path length of a null node is defined as?

Category: QuestionsIn a leftist heap, the null path length of a null node is defined as?
Editor">Editor Staff asked 5 months ago

In a leftist heap, the null path length of a null node is defined as?
 
(a) 0
 
(b) 1
 
(c) null
 
(d) -1
 
I’m obligated to ask this question of Heap topic in chapter Heap of Data Structures & Algorithms I
 
This question was posed to me in an interview for internship.

1 Answers
Editor">Editor Staff answered 5 months ago

Correct choice is (d) -1
 
To explain: In a leftist heap tree, the null path length of a null node with no children is defined as -1.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40701