Skip to content

Commit 0f2f43f

Browse files
author
tyler.liu
committed
HashMap + 二叉搜索树 Map 优化查找删除节点的右子树中的最小节点
1 parent 31bcbf9 commit 0f2f43f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

BST/bst/src/bst.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ string bst::bst_get(string key, unsigned int hash_key,BstNode *bst_p)
2727
bst_data = bst_data->next;
2828
}
2929
if( key == bst_data->key ){
30-
/// return bst_data->value;
30+
return bst_data->value;
31+
/*
3132
if(bst_p->parent != nullptr){
3233
return bst_data->value + "|" + bst_p->parent->data->value;
3334
}else{
3435
return bst_data->value + "|root";
35-
}
36+
}*/
3637
}else{
3738
return "null";
3839
}

0 commit comments

Comments
 (0)