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 2011-04-07 21:10

Linked lists if you need O(1) insertion at the beginning and tail(). If you don't care too much about space, you can use a doubly linked list (or, just use the xor trick).
Dynamic arrays if you need O(1) insertion at the end and random access.

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