Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Begin MainProgram
  2.  
  3. results = a new SET (a kd-tree)
  4. search(space,root,results)
  5. return results
  6. endMainProgram
  7.  
  8. Subroutine search(space,node,results)
  9. if (space contains node.region) then
  10. add node.point to the results
  11. for each descendant of node
  12. add d.point to results
  13. return
  14. if (space contains node.point) then
  15. add node.point to results
  16. if (space extends below node.coordinate) then
  17. search(space,node.below,results)
  18. if (space extends above node.coordinate) then
  19. search(space,node.above,results)
  20. endsubroutine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement