Skip to content

Instantly share code, notes, and snippets.

@ijingo
Created May 31, 2022 12:31
Show Gist options
  • Save ijingo/3b071101a464edcdf59af2e6e06a99e5 to your computer and use it in GitHub Desktop.
Save ijingo/3b071101a464edcdf59af2e6e06a99e5 to your computer and use it in GitHub Desktop.
package com.company;
public class Main {
static class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) { val = x; }
}
static class Codec {
// Encodes a tree to a single string.
public String serialize(TreeNode root) {
return new String();
}
// Decodes your encoded data to tree.
public TreeNode deserialize(String data) {
return null;
}
}
public static void main(String[] args) {
Codec ser = new Codec();
Codec deser = new Codec();
TreeNode root = new TreeNode(1);
root.left = new TreeNode(2);
TreeNode ans = deser.deserialize(ser.serialize(root));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment