Skip to content

Instantly share code, notes, and snippets.

@ijingo
Created June 13, 2022 03:24
Show Gist options
  • Save ijingo/6a7d60a05342f2ab3c80d335f6bbbe21 to your computer and use it in GitHub Desktop.
Save ijingo/6a7d60a05342f2ab3c80d335f6bbbe21 to your computer and use it in GitHub Desktop.
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