4 ms·
This is a serious question: is there ever an occasions when someone working on a real-world project should be implementing linked lists? I've no experience with
by bigfudge 16y ago
This is a serious question: is there ever an occasions when someone working on a real-world project should be implementing linked lists? I've no experience with C, but surely this stuff comes from libraries now?
- JoachimSchipper 16y agoThe C world has various reusable linked lists, but yes, there is occasionally a reason to implement one yourself: a {data, next} tuple usually fits in a single cache line, whereas some libraries only offer {data pointer, next} tuples, which requires loading in the memory that <data pointer> points to. The performance difference can matter. That said, some more agreement on reusable code may be useful, especially for things that aren't as easy to implement as linked lists.