Created
May 31, 2022 12:31
-
-
Save ijingo/3b071101a464edcdf59af2e6e06a99e5 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
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