KNN classifier implementation in C