将元素添加到VP树(VP树维护)

时间:2014-12-01 07:42:44

标签: search tree binary-search-tree similarity approximate-nn-searching

我已经在VP-tree上阅读了几个关于相似性的来源。 没有人写过将元素添加到存在树中,这是维护所必需的。 添加元素的说明非常棒。

1 个答案:

答案 0 :(得分:0)

add

public boolean add(E point)

Adds a single point to this vp-tree. Addition of a point executes in O(log n) time in the best case (where n is the number of points in the tree), but may also trigger a node partition that takes additional time.

Specified by:
    add in interface Collection<E extends GeospatialPoint>
Parameters:
    point - the point to add to this tree
Returns:
    true if the tree was modified by the addition of this point; vp-trees are always modified by adding points, so this method always returns true

addAll

public boolean addAll(Collection<? extends E> points)

Adds all of the points in the given collection to this vp-tree.

Specified by:
    addAll in interface Collection<E extends GeospatialPoint>
Parameters:
    points - the points to add to this tree
Returns:
    true if the tree was modified by the addition of the points; vp-trees are always modified by adding points, so this method always returns true

界面来自VPTree (jeospatial)

因此,您可以做的最好的事情是联系作者和/或在某处here搜索算法。


你理解我希望这对于SO来说太宽泛了,因此答案主要是一个相关的答案。