Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How would you learn how to implement that algorythm if you'd just use an existing implementation?



Read the wiki page on it, run through the psuedocode on pen and paper a few times and then implement it.

Source: I did this when I wrote a library for reverse geocoding which uses a kd tree.

https://github.com/AReallyGoodName/OfflineReverseGeocode


Implementing a spatial tree is not the same as implementing Nearest neighbours. It's just a data structure to allow efficient culling.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: