This is a coding sample I wrote a while back as part of a programming challenge I took part in. What exactly it does can be a little complicated to explain, but in a nutshell it’s a relatively advanced solution to a seemingly simple problem: “Given a known set of points, how can I find the point closest to me as quickly as possible?”. I wrote my solution over the course of a few evenings, and it uses what’s called a “KD-Tree” (as in k-dimensional tree) as a core part of the solution. The really cool thing about it is that it will work for points defined in any number of dimensions and will find always find the absolute best solution in a very efficient manner. When compiled it produces two main executables. The first part will read in a CSV file containing all the data points and construct a KD-tree data structure out of it before saving the tree to disk for later use. The second part will read in the tree from disk and a CSV of queries and then find the closest data point for each query and write out the results. Another executable is also included as a testing suite. Much more information can be found in the included documentation, including the readme file, a self-critique of my work, and the original prompt for the question.
-
Notifications
You must be signed in to change notification settings - Fork 0
License
Blasterdude/kd-tree-coding-challenge
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published