On Sun, Aug 8, 2010 at 10:32 PM, Meikel Brandmeyer <m...@kotka.de> wrote:
> I'm bit confused about what you mean here, but vector append (read:
> conj) is O(1) (don't nail me down on whether it's amortised). There is
> no array copying going on underneath.
>
Assuming vector is implemented in some form of array(well it seems to
have the characteristic of an array where accessing any element would
be O(1)), appending one element can be O(1) if there are space
reserved for some extra items but if that action is repeated till the
slack is filled up, some form of re-shuffling is needed. This compares
to a single link list which is just a nested cons.

So I fail to see how it can be O(1) in the cons sense where no
reshuffling would occur no matter how many cons are there.

As I said, I am not questioning the performance difference(I am pretty
sure it is very efficient), but curious.

-- 
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

Reply via email to