Struct catalan::FullBinaryTrees
source · pub struct FullBinaryTrees { /* private fields */ }
Expand description
A cache for full binary trees
Implementations§
source§impl FullBinaryTrees
impl FullBinaryTrees
sourcepub fn build_trees(&mut self, count: usize) -> Vec<Arc<BinaryNode>>
pub fn build_trees(&mut self, count: usize) -> Vec<Arc<BinaryNode>>
Arguments
count
: length of nodes
returns: Vec
Examples
let mut cache = FullBinaryTrees::default();
assert_eq!(cache.build_trees(3).len(), 2);
assert_eq!(cache.build_trees(4).len(), 5);
assert_eq!(cache.build_trees(5).len(), 14);
assert_eq!(cache.build_trees(6).len(), 42);
assert_eq!(cache.build_trees(7).len(), 132);
Trait Implementations§
source§impl Clone for FullBinaryTrees
impl Clone for FullBinaryTrees
source§fn clone(&self) -> FullBinaryTrees
fn clone(&self) -> FullBinaryTrees
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FullBinaryTrees
impl Debug for FullBinaryTrees
source§impl Default for FullBinaryTrees
impl Default for FullBinaryTrees
source§fn default() -> FullBinaryTrees
fn default() -> FullBinaryTrees
Returns the “default value” for a type. Read more