Implement k-means (k=2) splitting algorithm.