Y
Hacker News
new
|
ask
|
show
|
jobs
by
adsr
4114 days ago
You could keep pointers to both the head and tail in the list object though. Then adding and removing stuff would be O(1) for both ends.
1 comments
thaumaturgy
4114 days ago
Yep, and that used to be idiomatic, years and years ago when people still wrote their own linked lists. I'd be surprised if it isn't still the standard behavior for that data structure.
link