+1 vote
in Data Structures & Algorithms I by (110k points)
What is the priority of a null node?

(a) 1

(b) 0

(c) random number

(d) infinity

My doubt is from Binary Trees in division Binary Trees of Data Structures & Algorithms I

I got this question in an online quiz.

1 Answer

+1 vote
by (672k points)
selected by
Best answer
The correct answer is (d) infinity

Easiest explanation - The priority of a null node is set to be infinity in a treap so that during deletion, priority of that particular node is set to infinity, rotated and freed.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.