Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The two main cases when linked lists are better are (a) when you want to guarantee a low cost per insert, since vector insertion is only O(1) amortized, and (b) when you want to insert in the middle, but somehow found that middle without scanning the list.

Anyway, in this case, I guess they're using a free list because (1) it's simpler since you don't need an external collection keeping a list of unused stuff, and (2) reason (a) above.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: