Y
Hacker News
new
|
ask
|
show
|
jobs
by
dborg
4669 days ago
Actually you'd want to save it as (1 . (2 . (4 . (8 . NIL)))) since o/w you'd still get quadratic time complexity as you need to unpack your whole list when you add the next value.
2 comments
tehwalrus
4669 days ago
True! I forgot that you only keep a pointer to the start.
link
dllthomas
4669 days ago
or build it lazily...
link