diff options
Diffstat (limited to 'meowpp/dsa/VP_Tree.h')
-rw-r--r-- | meowpp/dsa/VP_Tree.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/meowpp/dsa/VP_Tree.h b/meowpp/dsa/VP_Tree.h index f8ab393..669eb0f 100644 --- a/meowpp/dsa/VP_Tree.h +++ b/meowpp/dsa/VP_Tree.h @@ -17,6 +17,10 @@ namespace meow{ //# `VP_Tree` 每次選一個點, 將資料分成 離這個點近的, 跟離這個點遠的. //# 至於怎麼選呢...., 嘛還沒研究, 先random //# + //# .參考資料連結: + //# * http://stevehanov.ca/blog/index.php?id=130[link] + //# * http://pnylab.com/pny/papers/vptree/vptree[link] + //# //#==== Template Class Operators Request //#[options="header",width="70%",cols="1>m,1<,3<s,5<,3<,15<",grid="rows"] //#|===================================================================== @@ -128,7 +132,7 @@ namespace meow{ //#|const|query|(Vector const& `v`,\size_t `i`,\bool `cmp`)|Vectors - //#|O(KN ^1-1/K^ ) + //#|O(logN) ~Expected~ //#|於set中找尋距離 `v` 前 `i` 近的向量, 並依照由近而遠的順序排序. //# 如果有兩個向量 `v1`,`v2` 距離一樣, 且 `cmp` 為 `true` , 則直接依照 //# `v1 < v2` 來決定誰在前面. 最後回傳一陣列包含所有解. @@ -154,6 +158,9 @@ namespace meow{ //# //#[NOTE] //#======================================== + //# * 實測結果發覺比 `KD_Tree` 有效率多了... + //# * 'TODO' `insert()`, `erase()` 算是未完成功能 + //# //#======================================== //# //# ''' |