1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 19:31:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<p>The data structure&nbsp;<code>TreeNode</code>&nbsp;is used for binary tree, but it can also used to represent a single linked list (where left is null, and right is the next node in the list). Implement a method to convert a binary search tree (implemented with <code>TreeNode</code>) into a single&nbsp;linked list. The values should be kept in order and the operation should be performed in place (that is, on the original data structure).</p>
<p>Return the head node of the linked list after converting.</p>
<p><b>Note:&nbsp;</b>This problem is slightly different from the original one in the book.</p>
<p>&nbsp;</p>
<p><strong>Example: </strong></p>
<pre>
<strong>Input: </strong> [4,2,5,1,3,null,6,0]
<strong>Output: </strong> [0,null,1,null,2,null,3,null,4,null,5,null,6]
</pre>
<p><strong>Note: </strong></p>
<ul>
<li>The number of nodes will not exceed&nbsp;100000.</li>
</ul>