Fix node return issue

v1
Brett 2023-01-10 22:29:26 -05:00
parent db27eae97b
commit 0926d7cc00
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ namespace blt {
// basically we are iterating through the tree looking for a valid node to insert into.
while (true) {
if (searchNode->payload == element)
return searchNode->payload;
return searchNode;
// check for left and right tree traversal if it exists
if (searchNode->left != nullptr && element < searchNode->left->payload) {
*parent = searchNode;