def deserialize(self, data):
        """
        Decodes your encoded data to tree.
        decode: 1, 2, 3, null, null, 4, 5, null, null, null, null
        :type data: str
        :rtype: TreeNode
        """
        lst = data.split(",")
        root = self.decode(lst[0])

        q = deque([root])
        i = 1
        while q:
            cur = q.popleft()
            if i < len(lst):
                cur.left = self.decode(lst[i])
                i += 1
                if cur.left: q.append(cur.left)
            if i < len(lst):
                cur.right = self.decode(lst[i])
                i += 1
                if cur.right: q.append(cur.right)

        return root
dataset/ETHPy150Open algorhythms/LeetCode/297 Serialize and Deserialize Binary Tree.py/Codec.deserialize/original