sequences the code for the append method is quite simple since the self last reference points at the node immediately preceding the place where we want to put the new nodewe just create new node and make the last one point at it then we make the new node the new self last node and increment the number of items by linkedlist insert def insert(self,index,item)cursor self first if index self numitemsfor in range(index)cursor cursor getnext( node linkedlist __node(itemcursor getnext()cursor setnext(nodeself numitems + elseself append(itemthe insert operationwhile it has the same complexity as insert on listis quite bit different for linked lists inserting into list is (noperation where is the number of elements that are in the list after the insertion point since they must all be moved down to make room for the new item when working with linkedlist the is the number of elements that appear before the insertion point because we must search for the correct insertion point this means that while inserting at the beginning of list is (noperationinserting at the beginning of linkedlist is ( operation if you will have to do many inserts near the beginning of listthen linked list may be better to use than randomly accessible list other linked list operations the other linked list operations are left as an exercise for the reader in many casesthe key to working with linked list is to get reference to the node that preceds the location you want to work with for instanceto delete node from linked list you merely want to make the next field of the preceeding node point to the node following the node you wish to delete consider the sample linked list in fig to delete the second item ( the " "from this list we want to remove the node that contains the reference to the "bto do this we can use cursor to find the node preceding the one that references the "bonce foundthe next field of the cursor can be made to point to the node after the "bas shown in fig changing the next pointer of the cursor' node to point to the node after the "bresults in the node containing the "bdropping out of the list since there are no other references to the node containing the " "and actually to the "bitselfthe two objects are garbage collected this copy belongs to 'acha