An implementation of KD-Trees written in Go, by Rishit Chaudhary.
- Efficiently find the nearest neighbor for a given node
- Find the node with the minimum value in a particular dimension
- Add a node to the KD-Tree
- Delete a node from the KD-Tree
- Stringify the KD-Tree to visualize it
- Encode the tree into bytes
- Decode the tree from bytes
Note: I have used FlatBuffers to encode and decode the KD-Tree.
The tests cover all API usages and are a great place to start to understand how to use them.
I've listed below all the references I've used to learn about KD-Trees working on this project.
- KD-Tree Nearest Neighbor Data Structure by Stable Sort
- Good KD Tree Visualization Fall 2019
- Good KD Tree Visualization Spring 2019
- K-D Tree: build and search for the nearest neighbor by Algokodabra
- K-d Trees - Computerphile
- Advanced Data Structures: K-D Trees by Niema Moshiri
- Advanced Data Structures: KDT Grid Representation by Niema Moshiri
- Advanced Data Structures: KDT Insertion Order and Balance by Niema Moshiri
- Node Deletion in KD-Tree
- The last example in this video lecture has an error. I've described and corrected this in my test case.