help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Easy to add with push but not to the end of a list


From: Michael Heerdegen
Subject: Re: Easy to add with push but not to the end of a list
Date: Wed, 30 Nov 2022 18:10:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Heime <heimeborgia@protonmail.com> writes:

> Although it is easy to add to a list using push, it currently looks
> hideous to be able to add to the end of a list.

In addition to what has already been said: if you store and update the
last cdr of your list (in a variable for example), you can add something
to the end of the list in O(1).  The cost is the cost of maintaining
additional data.

Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]