A treap is a cartesian tree with ___________

Category: QuestionsA treap is a cartesian tree with ___________
Editor">Editor Staff asked 5 months ago

A treap is a cartesian tree with ___________
 
(a) additional value, which is a priority value to the key generated randomly
 
(b) additional value, which is a priority value to the key generated sequentially
 
(c) additional heap rule
 
(d) additional operations like remove a range of elements
 
The query is from Cartesian Tree in portion Binary Trees of Data Structures & Algorithms I
 
The question was asked by my school teacher while I was bunking the class.

1 Answers
Editor">Editor Staff answered 5 months ago

Right choice is (a) additional value, which is a priority value to the key generated randomly
 
For explanation: A cartesian tree, if feeded with a sorted sequence will generate a straight path (or in tree terminology a skew tree). moreover a cartesian tree basing on same values from the search keys doesnot work well. so a cartesian tree with priority value in addition to search key is called treap.


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: 40702