Sunday, July 16, 2017

K closest points

July 16, 2017

K Closest Points


Problem:
Find the K closest points to the origin in 2D plane, given an array containing N points. You can assume K is much smaller than N and N is very large. You need only use standard math operators (addition, subtraction, multiplication, and division).
Code:


Study code: Java code is here


Plan to review C# practice using SortedSet and ICompare first, and then write a C# code for this K closest points. 



No comments:

Post a Comment