[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: |
Tue, 29 Nov 2022 11:00:44 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Marcin Borkowski wrote:
> The difference is that you keep adding items at the front
> and then reverse the list /once/.
But if `nreverse' is O(1) then you can do it twice, first
nreverse, then `car', then nreverse.
Don't you have to flip all the cell cdr links? O(n)?
> Yet another option would be to keep the whole list in some
> variable, but use another variable (say, `last') as
> a "pointer" to the last cons
Yes of course :)
--
underground experts united
https://dataswamp.org/~incal
- RE: [External] : Re: 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, Heime, 2022/11/28
- Re: Easy to add with push but not to the end of a list, Stefan Monnier, 2022/11/28
- 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/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, 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 <=
- 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
- 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, Dr Rainer Woitok, 2022/11/29
- Of cars and mice [was: Easy to add with push but not to the end of a list], tomas, 2022/11/29
- 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