A damm short kd-tree implementation in Python.
make_kd_tree
function: 12 linesadd_point
function: 9 linesget_knn
function: 21 linesget_nearest
function: 15 lines
No external dependencies like numpy, scipy, etc... and it's so simple that you can just copy and paste, or translate to other languages!
Your teacher will assume that you are a good student who coded it from scratch.
Just star this project if you find it helpful... so others can know it's better than those long winded kd-tree codes. ;)
License: CC0