title: What is the time complexity for deletion in singly and doubly linked lists?
body: <p>If we don't know the position of the node, is it true that both singly linked list and doubly linked list take <code>O(n)</code> time to delete?</p>
  
  <p>My understanding is that we need to traverse to node to know the previous pointer of the node and next pointer of node in singly linked list. The time complexity for singly linked list to delete is <code>O(n)</code> as a result.</p>
  
  <p>For doubly linked list, since we know the previous and next pointers of the node we want to delete, the time complexity is <code>O(1)</code>.</p>