advanced linked lists complex iterators the iterators designed and used in earlier were examples of simple iterators since we only needed to maintain single traversal variable more complex example would be the addition of an iterator to the sparsematrix class implemented as an array of linked lists in the previous or the multi-linked list version defined in this both of those implementations used an array of linked lists to store the matrix elements to build an iterator in this casewe must keep track of the array of linked lists and both the current row within the array and the current node within the linked list for the given row listing provides an implementation of an iterator for the sparse matrix adt implemented using multi-linked list when the iterator is first createdthe constructor must initialize the currow and curnode fields to reference the first node in the first non-empty row since listing an iterator for the sparse matrix adt implemented using multi-linked list defines python iterator for the sparse matrix adt implemented using an array of linked lists class _sparsematrixiterator def __init__selfrowarray )self _rowarray rowarray self _currow self _curnode none self _findnextelement(def __iter__self )return self def nextself )if self _curnode is none raise stopiteration else value self _curnode value self _curnode self _curnode next if self _curnode is none self _findnextelement(return value def _findnextelementself ) self _currow while lenself _rowarray and self _rowarray[iis none + self _currow if lenself _rowarray self _currnode self _rowvector[ielse self _currnode none