1.

What is the priority of a null node?(a) 1(b) 0(c) random number(d) infinityMy doubt is from Binary Trees in division Binary Trees of Data Structures & Algorithms II got this question in an online quiz.

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.



Discussion

No Comment Found

Related InterviewSolutions