What is the reason behind the simplicity of a treap?

Category: QuestionsWhat is the reason behind the simplicity of a treap?
Editor">Editor Staff asked 5 months ago

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 Answers
Editor">Editor Staff answered 5 months ago

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.


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