Insertion and deletion complexities for a linked list and array
-
04-11-2019 - |
문제
I have the following table that compares different operation complexities for a linked list and array:
Linked List | Array | Dynamic Array
Deletion at ending O(n) | O(1) | O(n)
Insertion in middle O(n) | O(n) | O(n)
Deletion in middle O(n) | O(n) | O(n)
Can anyone please explain why:
- Deletion for Dynamic Array is
O(n)
? - Insertion and deletion in middle for all data structures is
O(n)
?
Thanks
올바른 솔루션이 없습니다
제휴하지 않습니다 cs.stackexchange