As already discussed in the comments, to make things simple, you can add entries to the array to make its size a power of two, so the binary tree has the same depth for all leaves.
在评论中已经讨论的,使事情变得简单,你可以添加条目到阵列使其大小两个电源,所以二进制树的所有的叶子,相同的深度。
As already discussed in the comments, to make things simple, you can add entries to the array to make its size a power of two, so the binary tree has the same depth for all leaves.
在评论中已经讨论的,使事情变得简单,你可以添加条目到阵列使其大小两个电源,所以二进制树的所有的叶子,相同的深度。
应用推荐