From 0926d7cc0053adfc949abab68aad691fc28adcf4 Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 10 Jan 2023 22:29:26 -0500 Subject: [PATCH] Fix node return issue --- include/blt/std/binary_tree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/blt/std/binary_tree.h b/include/blt/std/binary_tree.h index 804b1bf..a070f81 100644 --- a/include/blt/std/binary_tree.h +++ b/include/blt/std/binary_tree.h @@ -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;