aboutsummaryrefslogtreecommitdiff
path: root/other/flatten_binary_to_linked.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'other/flatten_binary_to_linked.cpp')
-rw-r--r--other/flatten_binary_to_linked.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/other/flatten_binary_to_linked.cpp b/other/flatten_binary_to_linked.cpp
deleted file mode 100644
index 82751c7..0000000
--- a/other/flatten_binary_to_linked.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "leetcode.h"
-
-class Solution {
-public:
- void flatten(TreeNode *root) {
- if (root)
- helper(root);
- }
-
-private:
- TreeNode *head = nullptr;
- void helper(TreeNode *node) {
- if (node->right)
- helper(node->right);
- if (node->left)
- helper(node->left);
- node->left = nullptr;
- node->right = head;
- head = node;
- }
-};