linked structures matrix scaling the scaleby(method is very similar to the version used in the list implementation of the original sparse matrix adt from we need only traverse over each of the individual linked lists stored in the listofrows arrayduring which we scale the value stored in each node rememberthis is sufficient as elements not represented by nodes in the linked lists have zero values and thus would not be affected by scaling factor the matrix scaling operation requires (ktime in the worst case since only the non-zero elements are stored in the structure matrix addition the add method for this version of the sparse matrixwhich is provided in lines - of listing also follows the four steps outlined in section we first create new sparsematrix object that will contain the new matrix resulting from the addition thenthe contents of the self or lefthand-side matrix is copied to the new matrixone element at time finallywe traverse over the non-zero elements of the righthand-side matrix and add the values of its non-zero elements to the new matrix this implementation of the addition operationwhich requires (kntime in the worst caseis not the most efficient instead of using the getitem and setitem operationswe can use temporary traversal reference variables with each matrix to directly access the non-zero values in the two source matrices and to store the resulting non-zero values in the new matrix new implementation can be devised that only requires (ktime in the worst case comparing the implementations the sparse matrix adt implemented as an array of linked lists can be evaluated for any of the three casesbestaverageand worst the analysiswhich is left as an exercisedepends on the relationship between the total number of non-zero elementskand the number of columnsnin the matrix we implemented the matrix adt using - array that can be used to store sparse matrix and we implemented the sparse matrix adt using two different data structuresa list of matrixelement objectsand an array of linked lists table provides comparison of the worst case time-complexities between the three implementations for several of the matrix operations the - array implementation offers the best advantage of quick element access with the getitem and setitem methodsbut the other matrix operations are more costly while both the python list and the array of linked lists implementations provide similar timesthe array of linked lists version will typically provide better times since the efficiency for many of the operations is based on the number of columns in the matrix and not the total number of non-zero elements