no, distinct uses a hash-set (nearly-constant lookup) so distinct is O(n). On Tue, Aug 25, 2009 at 6:19 PM, sebastien <sebastien....@gmail.com> wrote:
> > > > The simplest I can think of is: > > (defn make-random-numbers [dim max] > > (take dim (distinct (repeatedly #(rand-int max))))) > > But distinct itself gives order of growth O(n!), through it scans > resulting list for every generated number, isn't it? > > > -- Professional: http://cgrand.net/ (fr) On Clojure: http://clj-me.blogspot.com/ (en) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---