The current Linked List module LL is clearly implemented as a singly-linked list.
I would like to see a doubly-linked list supported. The advantages would be ease of inserting and deleting nodes at any point, and efficiently adding nodes either at the beginning or end of the list that would work equally fast. Right now, to add at the end may require a search from a current node to the end, or else keeping a separate pointer to the end. Also, determining a "previous" node requires a search from the beginning in LL, while for a doubly-linked list no search is required.
For the name of this module, Doubly Linked List suggests a name of DLL. While this is possible, and hasn't been used yet, DLL *might* get confused with a Dynamic Link Library module. The confusion could be overcome with good documentation. Otherwise, we could pick a different name, like LLD, LL2 or L2L. I do kind of like DLL though.
If the current source for LL is available, I would consider writing the module, probably adapting it from the existing LL code. I don't see it as feasible or advisable to alter the LL to support double links, if for no other reason than not to break existing code.
Bookmarks