How can you save memory when storing color information in Red-Black tree?

Category: QuestionsHow can you save memory when storing color information in Red-Black tree?
Editor">Editor Staff asked 5 months ago

How can you save memory when storing color information in Red-Black tree?
 
(a) using least significant bit of one of the pointers in the node for color information
 
(b) using another array with colors of each node
 
(c) storing color information in the node structure
 
(d) using negative and positive numbering
 
I’m obligated to ask this question of Red Black Tree in portion Binary Trees of Data Structures & Algorithms I
 
This question was posed to me in homework.

1 Answers
Editor">Editor Staff answered 5 months ago

Correct choice is (a) using least significant bit of one of the pointers in the node for color information
 
Easiest explanation – The node pointers can be used to store color with the help of significant bits. the exceptions of this method are in languages like java where pointers are not used this may not work.


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