listing inserting value into an ordered doubly linked list given head and tail reference and new valueadd the new value to sorted doubly linked list newnode dlistnodevalue if head is none empty list head newnode tail head elif value head data insert before head newnode next head head prev newnode head newnode elif value tail data insert after tail newnode prev tail tail next newnode tail newnode else insert in the middle node head while node is not none and node data value node node next newnode next node newnode prev node prev node prev next newnode node prev newnode the circular linked list another variation of the linked list structure is the circular linked list in which the nodes form continuous circle the circular linked list allows for complete traversal of the nodes starting with any node in the list it is also commonly used for applications in which data is processed in round-robin fashion for examplewhen scheduling the use of cputhe operating system must cycle through all of the processes running on computerallowing each an opportunity to use the processor for short period of time by using circular linked listthe choice of the next process is made in round-robin fashion organization the nodes in circular linked listas illustrated in figure are organized in linear fashion the same as those in singly or doubly linked list in facta circular linked list can have single or double links in singly linked versionevery node has successor while in doubly linked version every node has successor and predecessor the nodes in circular list have the same structure as those in the linear list versions the only difference is the next field of the last node links to the firstand in the doubly linked versionthe prev field of the first node links to the last