Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C: linked lists or dynamic arrays?

Name: Anonymous 2011-04-07 20:56

As a general rule, should C programs use linked lists or dynamic arrays?

Name: Anonymous 2013-03-19 11:22

>>49
Yes, malloc is expensive
>>53
Generally you'd want a linked list of static arrays to implement a dynamic array so (when triggering a resize) you don't have to realloc and hope for another contiguous chunk of memory that is bigger than the current one you have.
Lookup is O(n/pagesize).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List