A node of the weight balanced tree has

Category: QuestionsA node of the weight balanced tree has
Editor">Editor Staff asked 5 months ago

A node of the weight balanced tree has
 
(a) key, left and right pointers, size
 
(b) key, value
 
(c) key, size
 
(d) key
 
The doubt is from Weight Balanced Tree topic in section Binary Trees of Data Structures & Algorithms I
 
This question was addressed to me in an online interview.

1 Answers
Editor">Editor Staff answered 5 months ago

Correct option is (a) key, left and right pointers, size
 
Best explanation: As a weight balanced tree stores height of the subtrees, we need to use size as an additional attribute to every node. also value(for mappings) may be an optional attribute.


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