mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			966 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			966 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给定一个单链表的头节点  <code>head</code> ,其中的元素 <strong>按升序排序</strong> ,将其转换为 <span data-keyword="height-balanced">平衡</span> 二叉搜索树。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<p><img src="https://assets.leetcode.com/uploads/2020/08/17/linked.jpg" style="height: 388px; width: 500px;" /></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong> head = [-10,-3,0,5,9]
 | 
						||
<strong>输出:</strong> [0,-3,9,-10,null,5]
 | 
						||
<strong>解释:</strong> 一个可能的答案是[0,-3,9,-10,null,5],它表示所示的高度平衡的二叉搜索树。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong> head = []
 | 
						||
<strong>输出:</strong> []
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>head</code> 中的节点数在<code>[0, 2 * 10<sup>4</sup>]</code> 范围内</li>
 | 
						||
	<li><code>-10<sup>5</sup> <= Node.val <= 10<sup>5</sup></code></li>
 | 
						||
</ul>
 |