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
Related Q & A:
- How to add a new table to a data source?Best solution by technet.microsoft.com
- Can I estimate the row count of a large mysql table using the disk space?Best solution by Database Administrators
- What is Hash Table, how to create a hash table?Best solution by Stack Overflow
- How to programatically select a item in list using c#?Best solution by Software Quality Assurance & Testing
- What is the best way to remember all of the elements on the periodic table?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.