figure doubly linked list reverse traversal algorithm reversetraversal(tail pretail is the tail node of the list to traverse postthe list has been traversed in reverse order tail while yield value previous end while end reversetraversal summary linked lists are good to use when you have an unknown number of items to store using data structure like an array would require you to specify the size up frontexceeding that size involves invoking resizing algorithm which has linear run time you should also use linked lists when you will only remove nodes at either the head or tail of the list to maintain constant run time this requires maintaining pointers to the nodes at the head and tail of the list but the memory overhead will pay for itself if this is an operation you will be performing many times what linked lists are not very good for is random insertionaccessing nodes by indexand searching at the expense of little memory (in most cases bytes would suffice)and few more read/writes you could maintain count variable that tracks how many items are contained in the list so that accessing such primitive property is constant operation you just need to update count during the insertion and deletion algorithms singly linked lists should be used when you are only performing basic insertions in general doubly linked lists are more accommodating for non-trivial operations on linked list we recommend the use of doubly linked list when you require forwards and backwards traversal for the most cases this requirement is present for exampleconsider token stream that you want to parse in recursive descent fashion sometimes you will have to backtrack in order to create the correct parse tree in this scenario doubly linked list is best as its design makes bi-directional traversal much simpler and quicker than that of singly linked