Apple interview question

Implement kNN’s and binary search.