Skip to content

Instantly share code, notes, and snippets.

@ijingo
Created June 2, 2022 02:20
Show Gist options
  • Save ijingo/cc232d80debb7b8873abb3ffafce4f15 to your computer and use it in GitHub Desktop.
Save ijingo/cc232d80debb7b8873abb3ffafce4f15 to your computer and use it in GitHub Desktop.
#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