Clojure install vs standalone vs dedupe?

So, if we need a set of unique elements, we can use a “set”.

If we already have a set of elements that we want to deduplicate, we could pass them to the set function, or, alternatively, we could use separate or deduplicate functions.

What are the situations for using each of them (pros / cons)?

Thank.

+4
source share
1 answer

The differences are as follows:

  • set willingly create a new collection of sets.
  • distinct . , , (, take)
  • dedupe , , set distinct. , (1 2 3 1 2 3) (1 1 1 2 3 3 1 1 2 2 2 3 3)

seq API- (, disj, get vs nth) (, O (log32 n) O (n) seq), , .

distinct dedupe .

+9

Source: https://habr.com/ru/post/1677430/


All Articles