Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 532 Bytes

File metadata and controls

11 lines (8 loc) · 532 Bytes

Problem 17: Persistent Binary State

Problem Statement

Design an algorithm to serialize and deserialize a binary tree. Serialization is the process of converting a data structure into a sequence of bits so that it can be stored. Deserialization is the reverse. There is no restriction on how your algorithm works.

Input Format

  • The root of a binary tree (for serialize) or a string (for deserialize).

Example

Input: root = [1, 2, 3, null, null, 4, 5]
Output: [1, 2, 3, null, null, 4, 5] (after round trip)