Design an algorithm to serialize a binary tree to a string and deserialize it back to the original tree structure.
Tree: 1
/ \
2 3
/ \
4 5
Serialized: "1,2,null,null,3,4,null,null,5,null,null"
Deserialized: same tree