Python Double Linked Lists utility, supporting Multiple Double Linked Lists
- lltail (tail node linker)
- llhead (head node linker)
- llprev (previous node linker)
- llnext (next node linker)
- int(self)
Tagged Linked List, useful to maintain original values and link them at the same moment through different Double Linked Lists. With the same instances, you could organize different Double Linked List, one for each chosen tag.
- llheads = [None, None, None, ....]; (head node linkers, one for each list)
- lltails = [None, None, None, ....]; (tail node linkers, one for each list)
- nexts = [None, None, None, ...] = (next node linkers, one for each list)
- prevs = [None, None, None, ...] = (previous node linkers, one for each list)
- indexes = [None, None, None, ...] = (index of node, one for each list)
- int(self)
Nodes are just 5. Class of these object is not important. It's necessary that this class has as parameter three arrays, called nexts, prevs and indexes with lenght the number of list to support. We can ipotize that these elements are cars. A car has these parameters: gasoline level (0,100) and speed (0,120) This tool can organize these 5 objects in a double linked list sorted by ascending gasoline level and a double linked list sorted by ascending speed at the same time.
Tagged Linked List, useful to maintain original values and link them at the same moment through different Double Linked Lists- With the same instances, you could organize different Double Linked List, one for each chosen tag.
- lists["tag" + "head"] = (head node linker)
- lists["tag" + "tail"] = (tail node linker)
- pointer["tag" + "prev"] = (previous node linker)
- pointer["tag" + "next"] = (next node linker)
- pointer["tag" + "index"] = (index of this list)
- int(self)
Nodes are just 5. Class of these object is not important. It's necessary that this class has as parameter a dictonary called "pointer" We can ipotize that these elements are cars. A car has these parameters: gasoline level (0,100) and speed (0,120) This tool can organize these 5 objects in a double linked list sorted by ascending gasoline level and a double linked list sorted by ascending speed at the same time.