This problem was asked by Google.
Given the root to a binary tree, implement serialize(root), which serializes the tree into a string, and deserialize(s), which deserializes the string back into the tree.
For example, given the following Node class class Node: def init(self, val, left=None, right=None): self.val = val self.left = left self.right = right