As a general rule, should C programs use linked lists or dynamic arrays?
Name:
Anonymous2011-04-07 21:13
The dynamic array has faster indexing - array to list, O(1) versus O(n) - but the linked list performs faster insertions at the front - array to list, O(n) versus O(1) - and insertions in the middle - array to list, search time + O(1) versus O(n). Some of these speed concerns can be mitigated by using a variant of a standard dynamic array.
As a general rule, your program should use whatever is the best implementation for your intentions.