[plt-scheme] append!?

From: Will Farr (farr at mit.edu)
Date: Sun Oct 21 16:49:03 EDT 2007

> The point is, in that case I should take care about last cons in the
> first list, right?

Actually, the total running time will be proportional to the sum of
the lengths of *all but the last list*.  (So it's the last cons of the
next-to-last list that "matters", not the last cons of the first
list.)  If append is called (as is typical) with only two arguments,
then it's the last cons of the first list that "matters".  For
example:

(append x y z) => time O((+ (length x) (length y)))
(append x y) => time O((length x))

Will


Posted on the users mailing list.