Updated K-means clustering algorithm with same cluster queries. Implemented algorithm through image segmentation