# Is it possible to use k-means algorithm with just one vector

Suppose I have a vector $$X = (x_1, x_2 , . . . ,x_n)$$, $$x_i$$ is the maximum of $$X$$ and $$x_k$$ is the minimum. Is it possible to use k-means algorithm to cluster the values in vector $$X$$ into two cluster. First, the values which are near to maximum value and the other cluster includes the values which are near to minimum value? If not, Is there another algorithm can do that task?

Thank you

• The answer by @Tolga Birdal says it all, it is possible. However, if you want to cluster the data with regards to the distance of the extreme values of your vector, you can also calculate the distances of all your entries to the minimum and maximum, and group them by thresholding them. The threshold could be set as (min+max)/2. – Irreducible Apr 29 '19 at 5:41