figure adding new node is two-step process recall that the linked list structure provides us with only one entry pointthe head of the list all of the other nodes can only be reached by accessing the first node and then following next links this means that the easiest place to add the new node is right at the heador beginningof the list in other wordswe will make the new item the first item of the list and the existing items will need to be linked to this new first item so that they follow the linked list shown in figure was built by calling the add method number of times mylist add( mylist add( mylist add( mylist add( mylist add( mylist add( note that since is the first item added to the listit will eventually be the last node on the linked list as every other item is added ahead of it alsosince is the last item addedit will become the data value in the first node of the linked list the add method is shown below each item of the list must reside in node object line creates new node and places the item as its data now we must complete the process by linking the new node into the existing structure this requires two steps as shown in figure step (line changes the next reference of the new node to refer to the old first node of the list now that the rest of the list has been properly attached to the new nodewe can modify the head of the list to refer to the new node the assignment statement in line sets the head of the list the order of the two steps described above is very important what happens if the order of line and line is reversedif the modification of the head of the list happens firstthe result can be seen in figure since the head was the only external reference to the list nodesall of the original nodes are lost and can no longer be accessed def add(selfitem)temp node(itemtemp set_next(self headself head temp the next methods that we will implement-sizesearchand remove-are all based on technique known as linked list traversal traversal refers to the process of systematically visiting each basic data structures