delete the node in linked list

How will you delete a node when a single pointer to that node is given.

Comments

  1. copy the contents of the next node to the node which is to be deleted.

    ReplyDelete
  2. @above what if it is the last node...

    ReplyDelete
  3. These r d thigs i cud come up wid :(
    dont delete the node ..just mark the node as dummy node....
    or implement your Linked list as a xor linked list
    http://en.wikipedia.org/wiki/XOR_linked_list

    ReplyDelete
  4. @ankit can you please explain what do you mean by marking the node as dummy node...

    ReplyDelete

Post a Comment

Popular posts from this blog