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: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-03-19 7:45

Ideally you'd allocate in multiples of page size and make sure all your data structures neatly pack into 4K chunks.

One way to get both O(1) insertion and O(1) indexing from a linked list is to build a "dynamic" array on the first indexing operation as a cache. IIRC Firefox does this for its DOM node structures.

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