Struct compt::GenTree [] [src]

pub struct GenTree<T> { /* fields omitted */ }

The complete binary tree. Internally stores the elements in a Vec so it is very compact. Height is atleast 1. Elements stored in BFS order. Has 2k-1 elements where k is the height.

Methods

impl<T> GenTree<T>
[src]

[src]

[src]

Create a complete binary tree using the specified node generating function.

[src]

Create a complete binary tree using the specified node generating function.

[src]

Create a complete binary tree using the specified node generating function.

[src]

Visit every node in BFS order. Due to underlying representation of the tree, this is just a fast loop.

[src]

Visit every node in BFS order. Due to underlying representation of the tree, this is just a fast loop.

[src]

Create a LevelDesc that can be passed to a LevelIter.

[src]

Create a immutable visitor struct

[src]

Create a mutable visitor struct

[src]

Consume the tree and return each element to the user in dfs order.

[src]

Returns the underlying elements as they are, in BFS order.