Remove duplicate elements: Difference between revisions
→ATS2 implementation using a radix sort
Line 657:
=== ATS2 implementation using a radix sort ===
This method runs in O(nw) time, where n is the number of elements n and w is a factor that is constant for a fixed-size integer. The method also sorts the unique elements
The implementation is for unsigned integers.
Radix sorting can sort an array of elements only into the encoding order of their keys, but that is a common case. Here the only reason to sort at all is to quickly eliminate duplicates.
<syntaxhighlight lang="ats">
|