With a dynamically growing array, growing it by a fixed amount has a O(1) amortized cost, with unpredictable performance on any append (you may allocate). Accessing any element is O(1). Finding the size is O(1). Splicing a new element into the interior is O(n).
A linked list has a guaranteed O(1) cost to grow. Splicing is also O(1). Accessing an arbitrary element is O(n). Finding the size is O(n). Splicing a new element into the interior is O(1).
Whether the linked list or array has more overhead is implementation and dataset dependent.
As for your mixed approach, you can do that and some have. Check out http://www.and.org/vstr/overview.html for an example of a string library that does. (I have not looked closely at it.) |