Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
adsr
· 11y ago · 0 comments
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.
Comments
[–]
thaumaturgy
11y 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.