I have a large array of mostly random numbers, with a few elements equal to each other. I need to change the array so that any elements that are equal are next to each other. Of course, sorting solves this problem but since I do not require the entire array to be in order I am assuming there are faster algorithms for this. I am mainly asking what is this process called so I can read up on it further. I need to understand the different approaches that exist and so am not looking for a specific algorithm, but any suggestions for such would be appreciated as well.Many thanks.
What is the process of bringing equal elements together in an array?
algorithms;sorting