Skip to content

Commit a85b6ed

Browse files
committed
Create README - LeetHub
1 parent 8649c2e commit a85b6ed

File tree

1 file changed

+28
-0
lines changed
  • 0297-serialize-and-deserialize-binary-tree

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<h2><a href="https://leetcode.com/problems/serialize-and-deserialize-binary-tree/">297. Serialize and Deserialize Binary Treea>h2><h3>Hardh3><hr><p>Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.p>
2+
3+
<p>Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization algorithm should work. You just need to ensure that a binary tree can be serialized to a string and this string can be deserialized to the original tree structure.p>
4+
5+
<p><strong>Clarification:strong> The input/output format is the same as <a href="https://support.leetcode.com/hc/en-us/articles/32442719377939-How-to-create-test-cases-on-LeetCode#h_01J5EGREAW3NAEJ14XC07GRW1A" target="_blank">how LeetCode serializes a binary treea>. You do not necessarily need to follow this format, so please be creative and come up with different approaches yourself.p>
6+
7+
<p>&nbsp;p>
8+
<p><strong class="example">Example 1:strong>p>
9+
<img alt="" src="https://assets.leetcode.com/uploads/2020/09/15/serdeser.jpg" style="width: 442px; height: 324px;" />
10+
<pre>
11+
<strong>Input:strong> root = [1,2,3,null,null,4,5]
12+
<strong>Output:strong> [1,2,3,null,null,4,5]
13+
pre>
14+
15+
<p><strong class="example">Example 2:strong>p>
16+
17+
<pre>
18+
<strong>Input:strong> root = []
19+
<strong>Output:strong> []
20+
pre>
21+
22+
<p>&nbsp;p>
23+
<p><strong>Constraints:strong>p>
24+
25+
<ul>
26+
  • The number of nodes in the tree is in the range [0, 104].
  • 27+
  • -1000 <= Node.val <= 1000
  • 28+
    ul>

    0 commit comments

    Comments
     (0)