mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
26 lines
965 B
HTML
26 lines
965 B
HTML
|
<p><em>满二叉树</em>是一类二叉树,其中每个结点恰好有 0 或 2 个子结点。</p>
|
||
|
|
||
|
<p>返回包含 <code>N</code> 个结点的所有可能满二叉树的列表。 答案的每个元素都是一个可能树的根结点。</p>
|
||
|
|
||
|
<p>答案中每个树的每个<code>结点</code>都<strong>必须</strong>有 <code>node.val=0</code>。</p>
|
||
|
|
||
|
<p>你可以按任何顺序返回树的最终列表。</p>
|
||
|
|
||
|
<p> </p>
|
||
|
|
||
|
<p><strong>示例:</strong></p>
|
||
|
|
||
|
<pre><strong>输入:</strong>7
|
||
|
<strong>输出:</strong>[[0,0,0,null,null,0,0,null,null,0,0],[0,0,0,null,null,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,null,null,null,null,0,0],[0,0,0,0,0,null,null,0,0]]
|
||
|
<strong>解释:</strong>
|
||
|
<img alt="" src="https://aliyun-lc-upload.oss-cn-hangzhou.aliyuncs.com/aliyun-lc-upload/uploads/2018/08/24/fivetrees.png" style="height: 400px; width: 700px;">
|
||
|
</pre>
|
||
|
|
||
|
<p> </p>
|
||
|
|
||
|
<p><strong>提示:</strong></p>
|
||
|
|
||
|
<ul>
|
||
|
<li><code>1 <= N <= 20</code></li>
|
||
|
</ul>
|