Remove duplicate elements: Difference between revisions

Content added Content deleted
Line 557: Line 557:
This method runs better than O(n*n) in the number of elements. It is an example of the brute-force technique.
This method runs better than O(n*n) in the number of elements. It is an example of the brute-force technique.


The implementation is for non-linear types, only.
The implementation is for non-linear types, only. I implement the predicate as a non-linear closure.


<syntaxhighlight lang="ats">
<syntaxhighlight lang="ats">