kNN queries
|
- Query
and a positive integer 
|
- For
, compute minimum distance to any object in it
|
|
|
- Maintain a heap with distance to
object as 
|
- Prune
if
|
|
|
- Initially,

|
- Traverse children in sorted order of

|
- Also compute maximum distance to any object in

|
|
|
- Prune
if
|
|
and 
|
|
- At least
objects in have lower distances
|