Amortized Efficiency

Design tradeoffs; which programming applications should use linked lists, which should use dynamic vectors, and why?
Last edited on
Lists got O(n) worst time complexity for accessing a specific element, but operations like shifting or deleting take constant O(1) time. Dynamic vectors on the other hand, got constant accessing time via subscript, so searching and sorting will be more efficient, but the problem is that it's still an array, so shifting and deleting is O(n), as well as once it gets full you need to increase its size, which consists in making another array with double elements and copy the previous elements in the next array
Thanks!
Topic archived. No new replies allowed.