Struct bk_tree::BKNode [] [src]

pub struct BKNode<K> {
    pub key: K,
    pub children: HashMap<u64, BKNode<K>>,
}

A node within the BK-tree.

Fields

The key determining the node.

A hash-map of children, indexed by their distance from this node based on the metric being used by the tree.

Methods

impl<K> BKNode<K>
[src]

Constructs a new BKNode<K>.

Add a child to the node.

Given the distance from this node's key, add the given key as a child node. Warning: this does not test the invariant that the distance as measured by the tree between this node's key and the provided key actually matches the distance passed in.

Examples

use bk_tree::BKNode;

let mut foo = BKNode::new("foo");
foo.add_child(1, "fop");

Trait Implementations

impl<K> Debug for BKNode<K> where
    K: Debug
[src]

Formats the value using the given formatter.