Created
June 2, 2022 02:20
-
-
Save ijingo/cc232d80debb7b8873abb3ffafce4f15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
struct TreeNode { | |
int val; | |
TreeNode *left; | |
TreeNode *right; | |
TreeNode(int x) : val(x), left(NULL), right(NULL) {} | |
}; | |
class Codec { | |
public: | |
// Encodes a tree to a single string. | |
std::string serialize(TreeNode* root) { | |
return ""; | |
} | |
// Decodes your encoded data to tree. | |
TreeNode* deserialize(const std::string& data) { | |
return nullptr; | |
} | |
}; | |
int main() { | |
auto node = new TreeNode(1); | |
auto left = new TreeNode(2); | |
auto leftleft = new TreeNode(2); | |
node->left = left; | |
left->left = leftleft; | |
// TreeNode* ans = deser.deserialize(ser.serialize(root)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment