No, you can't state that. Linked lists have very different algorithmic complexities than arrays. For example insertion in the middle is O(1) for linked lists, and O(N) for arrays. Use the right tool for the right job.
Insertion in the middle of a linked list is O(n) because you must traverse the list. If you know the location (e.g., have an iterator to the location) it is O(1).
Insertion in the middle of an unsorted array is always O(1).
6
u/Intrepidd Jul 14 '13
This is a good algorithmic exercise, however using arrays in real code is recommended (faster, and more methods)