figure result of reversing the order of the two steps figure traversing the linked list from the head to the end node to do this we use an external reference that starts at the first node in the list as we visit each nodewe move the reference to the next node by "traversingthe next reference to implement the size methodwe need to traverse the linked list and keep count of the number of nodes that occurred below we show the python code for counting the number of nodes in the list the external reference is called current and is initialized to the head of the list in line at the start of the process we have not seen any nodes so the count is set to lines - actually implement the traversal as long as the current reference has not seen the end of the list (none)we move current along to the next node via the assignment statement in line againthe ability to compare reference to none is very useful every time current moves to new nodewe add to count finallycount gets returned after the iteration stops figure shows this process as it proceeds down the list def size(self)current self head count while current !nonecount count current current get_next(return count searching for value in linked list implementation of an unordered list also uses the traversal technique as we visit each node in the linked list we will ask whether the data stored there matches the item we are looking for in this casehoweverwe may not have to traverse all the way to the end of the list in factif we do get to the end of the listthat means that the item we are looking for must not be present alsoif we do find the itemthere is no need to continue implementing an unordered listlinked lists