linked structures listing continued helper method for appending terms to the polynomial def _appendtermselfdegreecoefficient if coefficient ! newterm _polytermnodedegreecoefficient if self _polyhead is none self _polyhead newterm else self _polytail next newterm self _polytail newterm class for creating polynomial term nodes used with the linked list class _polytermnodeobject )def __init__selfdegreecoefficient )self degree degree self coefficient coefficient self next none basic operations the polynomial adt calls for two constructorsone for creating an empty polynomial and the other that can be used to create polynomial initialized with single term supplied as an argument in pythonwe can provide multiple constructors with the use of default values the constructorshown in lines - of listing defines two data fieldsthe head and tail pointersfor use with the linked list implementation these references are either initialized to none or set to point to the first node in the list depending on how the constructor was called the degree(method is simple to implement as it returns either the degree of the largest term that is stored in the first node or - if the polynomial is not defined for our adta polynomial is not defined if it does not contain any termswhich is indicated in our implementation by an empty list the get operationwhich we implement using the subscript operatorreturns the coefficient corresponding to specific term of the polynomial identified by degree linear search of the linked list is required to find the corresponding term since the nodes are sorted by degreewe can terminate the search early if we encounter node whose degree is smaller than the target after the loop terminatesthere are two possible conditions if there is no non-zero term with the given degreethen curnode will either be none or pointing to list node whose degree is smaller than the target in this casewe must return value of since by definition zero-term has coefficient of otherwisewe simply return the coefficient of the corresponding term pointed to by curnode polynomial is evaluated by supplying specific value for the variable used to represent each term and then summing the terms the evaluate(method is easily implemented as list traversal in which sum is accumulatedterm by term the result is (ntime operationwhere is the degree of the polynomial