pub struct Tree<T> { /* private fields */ }
Expand description
Tree<T>
represents the main tree data struct will be used during the FP-Growth algorithm.
Implementations§
Source§impl<T: ItemType> Tree<T>
impl<T: ItemType> Tree<T>
Sourcepub fn generate_partial_tree(paths: &[Vec<Rc<Node<T>>>]) -> Tree<T>
pub fn generate_partial_tree(paths: &[Vec<Rc<Node<T>>>]) -> Tree<T>
Generate a partial tree with the given paths. This function will be called during the algorithm.
Sourcepub fn add_transaction(&mut self, transaction: Vec<T>)
pub fn add_transaction(&mut self, transaction: Vec<T>)
Iterate the transaction and add every item to the FP-Growth tree.
Sourcepub fn update_route(&mut self, node: Rc<Node<T>>)
pub fn update_route(&mut self, node: Rc<Node<T>>)
Update the route table that records the item and its node list.
Sourcepub fn generate_prefix_path(&self, item: T) -> Vec<Vec<Rc<Node<T>>>>
pub fn generate_prefix_path(&self, item: T) -> Vec<Vec<Rc<Node<T>>>>
Generate the prefix paths that end with the given item.
Sourcepub fn get_all_nodes(&self, item: T) -> Vec<Rc<Node<T>>>
pub fn get_all_nodes(&self, item: T) -> Vec<Rc<Node<T>>>
Get all nodes that holds the given item.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Tree<T>
impl<T> !RefUnwindSafe for Tree<T>
impl<T> !Send for Tree<T>
impl<T> !Sync for Tree<T>
impl<T> Unpin for Tree<T>where
T: Unpin,
impl<T> !UnwindSafe for Tree<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more