File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ namespace alg
118
118
rbtree_node child;
119
119
if (n == NULL ) return ;
120
120
121
- /* Copy key/value from predecessor and then delete it instead */
121
+ /* Copy fields from predecessor and then delete it instead */
122
122
if (n->left != NULL && n->right != NULL ) {
123
123
ivltree_node pred = IVLNODE (maximum_node (n->left ));
124
124
n->low = pred->low ;
@@ -135,7 +135,14 @@ namespace alg
135
135
n->color = node_color (child);
136
136
delete_case1 (n);
137
137
}
138
+
138
139
replace_node (n, child);
140
+ // copy child value if exists, add your fields if you got one
141
+ if (child != NULL ) {
142
+ IVLNODE (n)->low = IVLNODE (child)->low ;
143
+ IVLNODE (n)->high = IVLNODE (child)->high ;
144
+ }
145
+
139
146
if (n->parent == NULL && child != NULL )
140
147
child->color = BLACK;
141
148
You can’t perform that action at this time.
0 commit comments