aboutsummaryrefslogtreecommitdiff
path: root/other/min_abs_diff_bst.cpp
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-06-27 12:23:02 -0600
committerJack Sangdahl <[email protected]>2025-06-27 12:23:02 -0600
commita96b65cbfad7f62f3db6b2eab105e4e25c0414c5 (patch)
treee2a2b3f49f9fb741be81415266ac93e74cff42ec /other/min_abs_diff_bst.cpp
parent694ad5ed71edcb1deccab54b72d706b779918276 (diff)
downloadleetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz
leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/min_abs_diff_bst.cpp')
-rw-r--r--other/min_abs_diff_bst.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/other/min_abs_diff_bst.cpp b/other/min_abs_diff_bst.cpp
deleted file mode 100644
index 0c0ef82..0000000
--- a/other/min_abs_diff_bst.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-// 530. Minimum Absolute Difference in BST
-#include "leetcode.h"
-
-/*
- * given the 'root' of a binary search tree (bst), return the minimum absolute
- * difference between the values of any two different nodes in the tree
- */
-
-class Solution {
- int diff = INT_MAX;
- TreeNode *prev = NULL;
- void dfs(TreeNode *root) {
- if (root->left)
- dfs(root->left);
- if (prev)
- diff = min(diff, abs(prev->val - root->val));
- prev = root;
- if (root->right)
- dfs(root->right);
- }
-
-public:
- int getMinimumDifference(TreeNode *root) {
- dfs(root);
- return diff;
- }
-};