English translate

We can number binary trees using the following scheme:
The empty tree is numbered 0.
The single-node tree is numbered 1.
All binary trees having m nodes have numbers less than all those having m+1 nodes.
Any binary tree having m nodes with left and right subtrees L and R is numbered n such that all trees having m nodes numbered > n have either Left subtrees numbered higher than L, or A left subtree = L and a right subtree numbered higher than R.

The first 10 binary trees and tree number 20 in this sequence are shown below:


Your job for this problem is to output a binary tree when given its order number.

我们可以使用以下方案对二叉树进行编号:
空树编号为 0。
单节点树编号为 1。
所有具有 m 个节点的二叉树的数量都小于所有具有 m+1 个节点的二叉树。
任何具有 m 个节点且具有左子树和右子树 L 和 R 的二叉树都被编号为 n,使得所有具有 m 个节点编号 > n 的树都具有编号高于 L 的左子树,或者一个左子树 = L 和一个编号高于 R 的右子树 .

该序列中的前 10 棵二叉树和第 20 棵树如下所示:

你要解决的问题就是再给定序号输出二叉树

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值