how to draw circular doubly linked list?

Why is the deletion of elements of a hash table using a doubly-linked list in O(1)?

  • On CLRS's textbook "Introduction to Algorithm",says we can delete an element in O(1) time if the lists are doubly linked. I do not get it how it differs from singly in case of deletion.

  • Answer:

    If the element x is with you -- so is the linked list node ! Now all u need to do is to delete the node! That deletion is O(1) -- because the linked list is doubly linked! Hope that makes it easy !

Nabarun Mondal at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.