bug fix
This commit is contained in:
@@ -144,8 +144,9 @@ namespace TinySTL{
|
|||||||
void binary_search_tree<T>::insert_elem(const T& val, node *&ptr){//<2F>ظ<EFBFBD><D8B8><EFBFBD>Ԫ<EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD>
|
void binary_search_tree<T>::insert_elem(const T& val, node *&ptr){//<2F>ظ<EFBFBD><D8B8><EFBFBD>Ԫ<EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD>
|
||||||
if (ptr == 0){
|
if (ptr == 0){
|
||||||
ptr = nodeAllocator::allocate();
|
ptr = nodeAllocator::allocate();
|
||||||
|
memset(ptr, 0, sizeof(node));
|
||||||
ptr->data_ = val;
|
ptr->data_ = val;
|
||||||
ptr->left_ = ptr->right_ = 0;
|
//ptr->left_ = ptr->right_ = 0;
|
||||||
++size_;
|
++size_;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
Reference in New Issue
Block a user