Home / CSE MCQs / Data Structure MCQs :: Discussion

Discussion :: Data Structure MCQs

  1. What is the space complexity for deleting a linked list?
  2. A.
    O(1)
    B.
    O(n)
    C.
    Either O(1) or O(n)
    D.
    O(logn)

    View Answer

    Workspace

    Answer : Option A

    Explanation :

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


Be The First To Comment