[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.
- Re: Of cars and mice [was: Easy to add with push but not to the end of a list], (continued)
- Re: Of cars and mice [was: Easy to add with push but not to the end of a list], Emanuel Berg, 2022/11/30
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/11/30
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/11/30
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/11/30
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/11/30
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/11/28
- Re: Easy to add with push but not to the end of a list, Dr Rainer Woitok, 2022/11/29
- Re: Easy to add with push but not to the end of a list,
Michael Heerdegen <=