|
|
@@ -285,13 +285,14 @@ bool AVLCommands::Delete(int key) {
|
|
|
parent->ReplaceChild(currentNode, currentNode->left_);
|
|
|
size_--; assert(size_ >= 0);
|
|
|
} else {
|
|
|
- currentNode->key_ = DeleteMin(currentNode);
|
|
|
+ currentNode->key_ = DeleteMin(currentNode->right_);
|
|
|
}
|
|
|
}
|
|
|
currentNode = (key < currentNode->key_) ?
|
|
|
currentNode->left_ : currentNode->right_;
|
|
|
}
|
|
|
|
|
|
+ //std::cout << "hi" << std::endl;
|
|
|
height(root_);
|
|
|
balance(currentNode);
|
|
|
|