Remove duplicate elements: Difference between revisions

m
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 aelements that are fixed-size integer. The method also sorts the unique elementsintegers.
 
The implementation is for unsigned integers and puts the unique numbers into a second array in ascending order.
 
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.
1,448

edits