【发布时间】:2014-12-01 07:42:44
【问题描述】:
我在 VP-tree 上阅读了一些关于相似度 knn 的资料。 没有人写过将元素添加到存在树,这是维护所必需的。 添加元素的解释会很棒。
【问题讨论】:
-
你是要为答案说点什么还是我应该删除它?
标签: search tree binary-search-tree similarity approximate-nn-searching
我在 VP-tree 上阅读了一些关于相似度 knn 的资料。 没有人写过将元素添加到存在树,这是维护所必需的。 添加元素的解释会很棒。
【问题讨论】:
标签: search tree binary-search-tree similarity approximate-nn-searching
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 来说太宽泛了,因此答案主要是一个链接的。
【讨论】: