News for hackers. Stuff that matters.
Re:Removing Array Duplicates by bjoli on Friday April 12, 2019 @03:09AM (#19642675)
It will probably be faster than the code in the article.
Re:Removing Array Duplicates by roel_v on Friday April 12, 2019 @03:46AM (#19642857)
How?
Re:Removing Array Duplicates by bjoli on Friday April 12, 2019 @11:44AM (#19645826)
It requires a single pass through the array, whereas the article suggests different approaches that all go through the array multiple times (or even O(n^2)). For small lists this is probably ok, but for big lists it is a very slow approach.

Edit: I would probably use a bloom filter for this.

Re:Removing Array Duplicates by saagarjha on Friday April 12, 2019 @04:13AM (#19642987)
It requires a single linear pass instead of a convoluted sort.
Re:Removing Array Duplicates by roel_v on Friday April 12, 2019 @04:38AM (#19643107)
... what sort? Are talking about the same thing here?
Re:Removing Array Duplicates by saagarjha on Friday April 12, 2019 @04:49AM (#19643159)
The code in the article has a sort in it.
Re:Removing Array Duplicates by KirinDave on Friday April 12, 2019 @05:19PM (#19649112)
Why would that be "more copies" than building up a hash table is what I don't get.
Re:Removing Array Duplicates by bjoli on Wednesday April 17, 2019 @05:12PM (#19686526)
It requires many passes through the list, and even O(LogN) is probably enough to make it slower than a hash based O(n) approach depending on list size. Hashing is fast. If space is an issue, just use an appropriately sized bloom filter.