1.

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 fieldI would like to ask this question from Binary Trees in division Binary Trees of Data Structures & Algorithms II have been asked this question during an interview.

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.



Discussion

No Comment Found

Related InterviewSolutions