On Jul 11, 5:44 am, Sunil S Nandihalli <sunil.nandiha...@gmail.com> wrote: > Hello everybody, > I think a lazy version of shuffle would be a good addtion to the core. I > tried googling for one and > foundhttp://ytakenaka.blogspot.com/2011/05/lazy-shuffle-clojure.htmlwhich was > infact slower than original shuffle and was unable to reproduce the > performance claims made there in. In fact the experiment showed that the > lazy-shuffle was about 10 times slower (of course depends on the size of the > collection to be shuffled).. Can somebody help me ? > > Thanks, > Sunil. I once created a lazy version of shuffle that worked on some random access collection (such as vector) using the Fisher-Yates algorithm that virtually swapped elements by using a map to keep track of index- >element remappings. It seemed to work rather well if you wanted a minority of the items in the original collection. I should try to dig up that code...
-- 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