Hacker's Delight #7 - Nearest Neighbor
Challenge: Write the fastest function possible to find the distance between the closest two points in a provided cloud of three dimensional points.
Download the test harness [.cpp] [.html]
Thank you for your tremendous interest in these Hacker's Delight challenges. We have had an overwhelming number of submissions to our previous challenges, and are enthusiastic to bring you yet another coding challenge for you to wrap your mind around. We would like to welcome the students from MIT and Brown Universities to this competition, as well as the ACM Collegiate programming competition members.
How to compete
Download the test harness [.cpp] [.html], grab your favorite compiler, and start hacking away. Due to the large number of submissions we are receiving, we ask that you carefully follow the guidelines laid out in the provided source code in order for your submission to be considered.
The Reference Solution
We have provided a simple naive solution for you to compare your results against.
Problem Constraints
-
You will be provided with a cloud of no more than 65535 points.
- The point cloud will not be a pathological case, such as points distributed in a regular grid pattern, on a surface of a sphere, or all on a single plane. We intend to test your algorithms against vertex lists from well known 3D meshes.
Submitting your entries
To submit an entry please email your code, (sans test harness), within the body of an email to hdsubmit@hejl.com. Submissions with attachments will be bounced back to the sender. Multiple submissions are allowed, but please annotate the namespace with a submission number.
Our new mailing list
If you haven't already, make sure to sign up for updates from the Hacker's Delight staff by sending a blank email to hackers-join@hejl.com!
--hackers