> rseq O(1), reverse O(n). > peek O(1), last O(n). > pop O(1), butlast O(n). > get O(1), nth O(n).
I don't see that in the documentation... If these functions aren't "collapsed", then it's better if at least (doc reverse) says something about O(n) and "see rseq". Carson On Nov 10, 8:16 am, Meikel Brandmeyer <m...@kotka.de> wrote: > Hi, > > On 10 Nov., 17:09, Gary Poster <gary.pos...@gmail.com> wrote: > > > I believe that the cost of having developers remember both rseq and reverse > > (why can't reverse just DTRT if it is given a vector?), last and peek > > (same), butlast and pop (same), and nth and get (same) is unnecessarily > > high. > > Ehm. No. > > rseq O(1), reverse O(n). > peek O(1), last O(n). > pop O(1), butlast O(n). > get O(1), nth O(n). > > (Where O(1) might sometimes mean O(log32 n)) > > The different functions are there under different names, because they > have different performance promises. Then peek is not equivalent to > last. For lists it is equivalent to first. > > Sincerely > Meikel -- 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