Skip to content

Commit

Permalink
Merge c46a433 into 1d7d256
Browse files Browse the repository at this point in the history
  • Loading branch information
KaruroChori committed Jul 30, 2019
2 parents 1d7d256 + c46a433 commit a88854e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions avl_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,23 @@ class avl_array
}
}
else {
const size_type parent = get_parent(node);
child_[parent].left == node ? child_[parent].left = right : child_[parent].right = right;
const size_type parent = get_parent(node);
if(parent != INVALID_IDX){
child_[parent].left == node ? child_[parent].left = right : child_[parent].right = right;
}
else root_=right;

set_parent(right, parent);
set_parent(right, parent);

delete_balance(right, 0);
delete_balance(right, 0);
}
}
else if (right == INVALID_IDX) {
const size_type parent = get_parent(node);
child_[parent].left == node ? child_[parent].left = left : child_[parent].right = left;
if(parent != INVALID_IDX){
child_[parent].left == node ? child_[parent].left = left : child_[parent].right = left;
}
else root_=left;

set_parent(left, parent);

Expand Down

0 comments on commit a88854e

Please sign in to comment.