we can append few itemswords singlylinkedlist(words append('egg'words append('ham'words append('spam'list traversal will work more or less like before you will get the first element of the list from the list itselfcurrent words tail while currentprint(current datacurrent current next faster append operation there is big problem with the append method in the previous sectionit has to traverse the entire list to find the insertion point this may not be problem when there are just few items in the listbut wait until you need to add thousands of items each append will be slightly slower than the previous one (ngoes to prove how slow our current implementation of the append method will actually be to fix thiswe will storenot only reference to the first node in the listbut also reference to the last node that waywe can quickly append new node at the end of the list the worst case running time of the append operation is now reduced from (nto ( all we have to do is make sure the previous last node points to the new nodethat is about to be appended to the list here is our updated codeclass singlylinkedlistdef __init__(self)self tail none def append(selfdata)node node(dataif self headself head next node self head node elseself tail node self head node