figure searching an ordered linked list to implement the orderedlist classwe will use the same technique as seen previously with unordered lists once againan empty list will be denoted by head reference to none class orderedlistdef __init__(self)self head none as we consider the operations for the ordered listwe should note that the is_empty and size methods can be implemented the same as with unordered lists since they deal only with the number of nodes in the list without regard to the actual item values likewisethe remove method will work just fine since we still need to find the item and then link around the node to remove it the two remaining methodssearch and addwill require some modification the search of an unordered linked list required that we traverse the nodes one at time until we either find the item we are looking for or run out of nodes (noneit turns out that the same approach would actually work with the ordered list and in fact in the case where we find the item it is exactly what we need howeverin the case where the item is not in the listwe can take advantage of the ordering to stop the search as soon as possible for examplefigure shows the ordered linked list as search is looking for the value as we traversestarting at the head of the listwe first compare against since is not the item we are looking forwe move to the next nodein this case againthis is not what we wantso we move on to and then on to nowat this pointsomething is different since is not the item we are looking forour former strategy would be to move forward howeverdue to the fact that this is an ordered listthat will not be necessary once the value in the node becomes greater than the item we are searching forthe search can stop and return false there is no way the item could exist further out in the linked list the following code shows the complete search method it is easy to incorporate the new condition discussed above by adding another boolean variablestopand initializing it to false (line while stop is false (not stopwe can continue to look forward in the list (line if any node is ever discovered that contains data greater than the item we are looking forwe will set stop to true (lines - the remaining lines are identical to the unordered list search def search(selfitem)current self head found false stop false while current !none and not found and not stop the ordered list abstract data type