The fact is that the set of Dutch flags is not completely streamlined. There are many equal elements, because when you count individual objects, this is a set (no more) of size 3.
The Omega(n log n) constraint is probably only complicated if either a<b or b>a holds for objects a and b (aka: all objects are different )
In fact, I can sort in O(0) when all objects must be null .
Assuming there are at least two different objects, I believe that the correct border is something like Omega(n log m) , where n is the number of objects and m is the number of separate objects (which do not sort the same), Simply put , log m is the number of solutions needed to find the output bucket. In the general case, O(log m)=O(log n) if the number of equal objects is small. In the Dutch flag problem m=3 .
Radix sort uses this differently. It is also considered linear. However, this requires log m , and m is the number of possibly individual elements. So actually Radix sorting is also Omega(n log m) , where m is the number of objects that it can distinguish.
source share