Examples
Basic Examples (1)
Arrange 20 elements on a complete binary tree:
Options (2)
ListToBinaryTree accepts the same options as Tree:
ListToBinaryTree accepts multiple options:
Properties and Relations (2)
A complete binary tree of height h has at least 2h nodes and at most 2h+1-1 nodes. For instance when h=4:
The height of the tree are the same for both complete binary trees:
A complete binary tree of 2k-1 nodes is the same as complete Kary tree with (k-1) 2's:
Possible Issues (1)
The length of the input must be at least one. Otherwise the function returns unevaluated:
Neat Examples (2)
Use binary expansion of n as input to create a complete binary tree and then read those bits in pre-order (OEIS A380856):
Specify TreeTraversalOrder to implement pre-order traversal:
The new number and its associated complete binary tree:
Every integer is associated with a permutation group using the operation from OEIS A380856:
Use n=65537 for example:
The order of the permutation group associated with 65537 is 15:
Repeat 15 times the rearrangement of binary bits of 65537 on complete binary tree using pre-order traversal will return to the original number:
List the numbers and their complete binary tree representation:
Remove unused items in the deque:
Publisher
Shenghui Yang
Related Links
Requirements
Wolfram Language 14.0
(January 2024) or above
Version History
-
1.0.1
– 18 March 2025
-
1.0.0
– 07 March 2025
Related Resources