Browse Source

Merge branch 'tree_alloc' of gitea:cameron/cs241-project into tree_alloc

tree_alloc
Thomas Johnson 1 year ago
parent
commit
2c0d27f7d7
  1. 4
      tree_alloc.c

4
tree_alloc.c

@ -341,7 +341,7 @@ void insert_singleton(TreeAlloc **root_ptr, TreeAlloc *to_insert) {
#endif
*root_ptr = to_insert;
to_insert->parent = NULL;
repair_tree_after_insert(root_ptr, to_insert);
to_insert->color = COLOR_BLACK;
}
void insert_right(TreeAlloc** root_ptr, TreeAlloc* to_insert, TreeAlloc* after) {
@ -357,6 +357,7 @@ void insert_right(TreeAlloc** root_ptr, TreeAlloc* to_insert, TreeAlloc* after)
}
after->right = to_insert;
to_insert->parent = after;
to_insert->color = COLOR_RED;
repair_tree_after_insert(root_ptr, to_insert);
}
@ -373,6 +374,7 @@ void insert_left(TreeAlloc** root_ptr, TreeAlloc* to_insert, TreeAlloc* before)
}
before->left = to_insert;
to_insert->parent = before;
to_insert->color = COLOR_RED;
repair_tree_after_insert(root_ptr, to_insert);
}

Loading…
Cancel
Save