Lurker News
Back to discussion

Comment by dan-robertson

dan-robertson1 reply#
I think the theme is ‘you can’t do arrays; the best approximation is made of trees, hence log n in the size of the array vs 1’.
remexre1 reply#
Though I think Clojure has a linear datastructure that's O(log32(n)) for all the common ops. (This is the one with all the memeing because someone called it "practically O(1)".)
dan-robertson1 reply#
Right, and updates are also O(32 log32(n)) rather than O(2log2(n)), rather than O(1) for arrays. It’s a bit more complicated when you think about cache lines being updated but mutable arrays massively win on cache
kaba02 replies#
Why do you have a constant before the log term? Isn’t that completely meaningless?

Continue this thread — 2 replies