Crate flattree [] [src]

flat-tree helps you represent a binary tree in a simple flat list.

The tree will be saved using the following structure

      3
  1       5
0   2   4   6  ...

Enums

TreeError

Functions

children

returns [left_child, right_child] of the element

count
depth

returns the depth of an element

full_roots

return a vector contains all the full roots whos index < i

index
left_child

returns the index of the left child of the element

left_span
offset
parent

returns the index of the parent of the element

right_child

returns the index of the right child of the element

right_span
sibling

returns the index of the element's sibling

spans