[LeetCode] Serialize and Deserialize Binary Tree

  • 时间:
  • 浏览:1
  • 来源:uu快3规律_uu快3下载地址_窍门

The serialization and deserialization both use the BFS traversal. The code is as follows.

I adopt a way similar to that of the OJ to serialize the binary tree. For the following tree, my serialization result is "1,2,3,null,null,4,5," (note the last comma).