Created
June 13, 2022 03:24
-
-
Save ijingo/6a7d60a05342f2ab3c80d335f6bbbe21 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
type TreeNode struct { | |
Val int | |
Left *TreeNode | |
Right *TreeNode | |
} | |
type Codec struct { | |
} | |
func Constructor() Codec { | |
} | |
// Serializes a tree to a single string. | |
func (this *Codec) serialize(root *TreeNode) string { | |
} | |
// Deserializes your encoded data to tree. | |
func (this *Codec) deserialize(data string) *TreeNode { | |
} | |
/** | |
* Your Codec object will be instantiated and called as such: | |
* ser := Constructor(); | |
* deser := Constructor(); | |
* data := ser.serialize(root); | |
* ans := deser.deserialize(data); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment