What is the space complexity for deleting a linked list?

Q & ACategory: Data StructureWhat is the space complexity for deleting a linked list?
Admin Staff asked 5 years ago

What is the space complexity for deleting a linked list?
a) O(1)
b) O(n)
c) Either O(1) or O(n)
d) O(logn)

1 Answers
Admin Staff answered 5 years ago

a) O(1)