BlackBerry interview question

Code k means clustering algorithm.