O(n)
time with arrays become O(1)
time with LLs because all subsequent elements do not need to be shifted in memory. Only pointers of previous and next elements in the list need to be updated.O(1)
time with arrays becomes O(n)
time with LLs because the only way to access an element in the middle of a LL is to traverse the list until we reach that element.O(n)
O(1)
O(1)
O(n)
(O(1)
if we have pointer to tail node with doubly-linked list)O(n)
O(n)
(O(1)
if we have pointer to the node to be deleted)O(1)
O(n)