- an array is sparse if most of its entries are empty ( nonea list can be used to implement such an array efficiently in particularfor each nonempty cell [ ]we can store an entry (iein lwhere is the element stored at [ithis approach allows us to represent using (mstoragewhere is the number of nonempty entries in provide such sparsearray class that minimally supports methods getitem (jand setitem (jeto provide standard indexing operations analyze the efficiency of these methods - although we have used doubly linked list to implement the positional list adtit is possible to support the adt with an array-based implementation the key is to use the composition pattern and store sequence of position itemswhere each item stores an element as well as that element' current index in the array whenever an element' place in the array is changedthe recorded index in the position must be updated to match given complete class providing such an array-based implementation of the positional list adt what is the efficiency of the various operationsp- implement cardhand class that supports person arranging group of cards in his or her hand the simulator should represent the sequence of cards using single positional list adt so that cards of the same suit are kept together implement this strategy by means of four "fingersinto the handone for each of the suits of heartsclubsspadesand diamondsso that adding new card to the person' hand or playing correct card from the hand can be done in constant time the class should support the following methodsadd card(rs)add new card with rank and suit to the hand play( )remove and return card of suit from the player' handif there is no card of suit sthen remove and return an arbitrary card from the hand iter )iterate through all cards currently in the hand all of suit( )iterate through all cards of suit that are currently in the hand notes view of data structures as collections (and other principles of object-oriented designcan be found in object-oriented design books by booch [ ]budd [ ]goldberg and robson [ ]and liskov and guttag [ our positional list adt is derived from the "positionabstraction introduced by ahohopcroftand ullman [ ]and the list adt of wood [ implementations of linked lists are discussed by knuth [