algorithm - What's the meaning of "few-unique" at sorting? -


all

On the above site, accelerated 3-way split algorithm I found myself in 4 different cases. I understand random, almost random, opposite case. But what is "something unique" ??? Does that mean a bigger integer key ?? Can you expand? Thank you.

In this context, I think some unique tools: even if you have a huge array, The set of possible values ​​is too small, it also means that there are many duplicates.

Example: 3, 10, 50, 10, 10, 3, 10, 3, 50, 3, 50, 50, 3, 10, 10, 50, 3, 3, 10, 50, 50 , 3 ...

The set of unique / unique values ​​is {3, 10, 50} , even if the data collection is a lot bigger

If you want to arrange the array, you can simply count a frequency where the values ​​of values ​​are: 3: 8 occurrences 10: 7 occurences 50: 7 occurences

Then sorting is trivial: just 3 times '8', 7 times '10' And put 7 times '50'. If you have other columns, then calculating multiplication is not enough, you have to create an index, but this idea is similar.


Comments