+1 vote
in Data Structures & Algorithms I by (110k points)
What is the reason behind the simplicity of a treap?

(a) Each node has data and a pointer

(b) Each node is colored accordingly

(c) It is a binary search tree following heap principles

(d) Each node has a fixed priority field

I would like to ask this question from Binary Trees in division Binary Trees of Data Structures & Algorithms I

I have been asked this question during an interview.

1 Answer

+1 vote
by (737k points)
selected by
Best answer
Right option is (d) Each node has a fixed priority field

The explanation is: A treap is the simplest of all because we don’t have to worry about adjusting the priority of a node.

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.