From 01f9fae4a0df8d5620c79d12f91213d42e853574 Mon Sep 17 00:00:00 2001 From: iHR4K <114698406+iHR4K@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:50:01 -0400 Subject: [PATCH 1/3] wrong index has been fixed --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 5951e23..5d126e9 100644 --- a/main.cpp +++ b/main.cpp @@ -245,9 +245,9 @@ int main() root = deleteNode(root, points[0]); cout << "Root after deletion of (" << origRoot->point[0] <<"," << origRoot->point[1] <<"," << origRoot->point[2] << ")\n"; - cout << root->point[0] << "," << root->point[1] <<"," << root->point[3] << endl; + cout << root->point[0] << "," << root->point[1] <<"," << root->point[2] << endl; return 0; -} \ No newline at end of file +} From 588b1cb64d5c3ecc47f5f71d1c9d74b8fd92c667 Mon Sep 17 00:00:00 2001 From: iHR4K <114698406+iHR4K@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:53:25 -0400 Subject: [PATCH 2/3] another wrong index --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 5d126e9..e1eb021 100644 --- a/main.cpp +++ b/main.cpp @@ -225,7 +225,7 @@ int main() //Testing out minimum value in a 3-dimensional tree. struct Node *minVal = NULL; findMin(root, 3); - cout << "(" << root->point[0] << "," << root->point[1] <<"," << root->point[3] << ")" << endl; + cout << "(" << root->point[0] << "," << root->point[1] <<"," << root->point[2] << ")" << endl; //Testing the search functionality of a 3-dimensional Tree. From 5c3e73bd54742f15fff330b6479a0e72f33a7307 Mon Sep 17 00:00:00 2001 From: iHR4K <114698406+iHR4K@users.noreply.github.com> Date: Thu, 3 Aug 2023 17:35:06 -0400 Subject: [PATCH 3/3] it looks like d was used by mistake --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index e1eb021..d6d4ffa 100644 --- a/main.cpp +++ b/main.cpp @@ -132,7 +132,7 @@ Node *findMinRec(Node* root, int d, unsigned depth) // in this subtree return minNode(root, findMinRec(root->left, d, depth+1), - findMinRec(root->right, d, depth+1), d); + findMinRec(root->right, d, depth+1), cd); } // A wrapper over findMinRec(). Returns minimum of d'th dimension