kd search

i have most of the code and the most important details i only need to form and write the full code and make it running to solve the search for the nearest point to an input in 16 dimension
the idea is
the user inter a point
the program first deside in which diminishing is going to search ( it is 16 dim )
then will do the kd search for the nearest point to this entry
if you know c programing and has an idea about kd tree search you can help in this project when i give you my note for the code, the main idea here is the 16 dimension rather than regular 3 or 2 in regular kd
i need the code to run in right answer