Categories
FollowersBlog Archive
Jobs
Find more freelance jobs
|
Saturday, February 2, 2008Under what circumstances can one delete an element from a singly linked list in constant time?
If the list is circular and there are no references to the nodes in the list from anywhere else! Just copy the contents of the next node and delete the next node. If the list is not circular, we can delete any but the last node using this idea. In that case, mark the last node as dummy!
Subscribe to:
Post Comments (Atom)
|
Popular Posts
|
No comments:
Post a Comment