title: Insertion/Deletion of Doubly Linked List in constant time O(1)
body: <p>a) I have seen a lot of examples of this question in stackoverflow but I am still having problems understanding how does it know which node it is referring when call functions like insertAfter(Node n, Object o). If we say insert after node 2, how does linkedlist know which node is node 2?</p>
  
  <p>b) in the previous posts in stackoverflow, it is said there is a pointer to a node that you want to insert after or before, that is why we get constant time operations. does that mean, just like we have to head and tail in linked list, we also have a pointer to each node?</p>
  
  <p>would really appreciate help in understanding this.</p>