Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

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)

Answer: a
Explanation: You need a temp variable to keep track of current node, hence the space complexity is O(1).

Join The Discussion