chap lists and arrays revisited and solving for xwe find that the sparse matrix using this implementation is more space efficient when / that iswhen less than about of the elements are non-zero different values for the relative sizes of data valuespointersor matrix indices can lead to different break-even point for the two implementations the time required to process sparse matrix depends on the number of nonzero elements stored when searching for an elementthe cost is the number of elements preceding the desired element on its row or column list the cost for operations such as adding two matrices should be th( min the worst case when the one matrix stores non-zero elements and the other stores non-zero elements memory management most of the data structure implementations described in this book store and access objects of uniform sizesuch as integers stored in list or tree few simple methods have been described for storing variable-size records in an array or stack this section discusses memory management techniques for the general problem of handling space requests of variable size the basic model for memory management is that we have (largeblock of contiguous memory locationswhich we will call the memory pool periodicallymemory requests are issued for some amount of space in the pool the memory manager must find contiguous block of locations of at least the requested size from somewhere within the memory pool honoring such request is called memory allocation the memory manager will typically return some piece of information that permits the user to recover the data that were just stored this piece of information is called handle previously allocated memory might be returned to the memory manager at some future time this is called memory deallocation we can define an adt for the memory manager as shown in figure the user of the memmanager adt provides pointer (in parameter spaceto space that holds some message to be stored or retrieved this is similar to the java basic file read/write methods presented in section the fundamental idea is that the client gives messages to the memory manager for safe keeping the memory manager returns "receiptfor the message in the form of memhandle object the client holds the memhandle until it wishes to get the message back method insert lets the client tell the memory manager the length and contents of the message to be stored this adt assumes that the memory manager will remember the length of the message associated with given handlethus method get does not include length parameter but instead returns the length of the mes