mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 03:33:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			695 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			695 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历结果。如果是则返回 <code>true</code>,否则返回 <code>false</code>。假设输入的数组的任意两个数字都互不相同。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p>参考以下这颗二叉搜索树:</p>
 | 
						||
 | 
						||
<pre>     5
 | 
						||
    / \
 | 
						||
   2   6
 | 
						||
  / \
 | 
						||
 1   3</pre>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre><strong>输入: </strong>[1,6,3,2,5]
 | 
						||
<strong>输出: </strong>false</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre><strong>输入: </strong>[1,3,2,6,5]
 | 
						||
<strong>输出: </strong>true</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ol>
 | 
						||
	<li><code>数组长度 <= 1000</code></li>
 | 
						||
</ol>
 |