Struct compt::GenTree
[−]
[src]
pub struct GenTree<T> { /* fields omitted */ }
The complete binary tree. Internally stores the elements in a Vec
Methods
impl<T> GenTree<T>
[src]
fn get_height(&self) -> usize
[src]
fn from_dfs<F: FnMut() -> T>(func: F, height: usize) -> GenTree<T>
[src]
Create a complete binary tree using the specified node generating function.
fn from_dfs_backwards<F: FnMut() -> T>(func: F, height: usize) -> GenTree<T>
[src]
Create a complete binary tree using the specified node generating function.
fn from_bfs<F: FnMut() -> T>(func: F, height: usize) -> GenTree<T>
[src]
Create a complete binary tree using the specified node generating function.
fn bfs<F: FnMut(&T)>(&self, func: F)
[src]
Visit every node in BFS order. Due to underlying representation of the tree, this is just a fast loop.
fn bfs_mut<F: FnMut(&mut T)>(&mut self, func: F)
[src]
Visit every node in BFS order. Due to underlying representation of the tree, this is just a fast loop.
fn get_level_desc(&self) -> LevelDesc
[src]
Create a LevelDesc that can be passed to a LevelIter.
fn create_down(&self) -> DownT<T>
[src]
Create a immutable visitor struct
fn create_down_mut(&mut self) -> DownTMut<T>
[src]
Create a mutable visitor struct
fn into_dfs_preorder<F: FnMut(T)>(self, func: F)
[src]
Consume the tree and return each element to the user in dfs order.
fn get_nodes(&self) -> &[T]
[src]
Returns the underlying elements as they are, in BFS order.