[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: |
Emanuel Berg |
Subject: |
Re: Easy to add with push but not to the end of a list |
Date: |
Mon, 28 Nov 2022 23:58:27 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Stefan Monnier via Users list for the GNU Emacs text editor wrote:
> Add them in the reverse order and finish with a simple
> `reverse`. That's a very standard design pattern with
> singly-linked lists (and in many/most cases the final
> `reverse` can be an `nreverse`).
I thought about `nreverse' but if that changes all the CDRs
then that's linear as well i.e. O(n), otherwise you could do
nreverse, `push', and nreverse again ...
--
underground experts united
https://dataswamp.org/~incal
- RE: [External] : Easy to add with push but not to the end of a list, (continued)
- Re: Easy to add with push but not to the end of a list, tomas, 2022/11/29
- Re: Easy to add with push but not to the end of a list, Heime, 2022/11/29
- Re: Easy to add with push but not to the end of a list, Marcin Borkowski, 2022/11/29
- Re: Easy to add with push but not to the end of a list, Heime, 2022/11/29
- 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, tomas, 2022/11/29
- 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, Marcin Borkowski, 2022/11/29