« Return to Thread: List concat

Re: List concat

by ajb-2 :: Rate this Message:

Reply to Author | View in Thread

G'day all.

Quoting Andrew Coppin <andrewcoppin@...>:

> The function (++) :: [x] -> [x] -> [x] has O(n) complexity.

That's not entirely true.

When you call (++), it does O(1) work.  If you evaluate k cons cells.
it takes O(min(k,n)) work.

Cheers,
Andrew Bromage
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

 « Return to Thread: List concat

LightInTheBox - Buy quality products at wholesale price