1 The game of Life is de_ned for an in_nite-sized grid. In Chapter 2, we de_ned the Life Grid ADT to use a _xed-size grid in which the user speci_ed the width and height of the grid. This was su_cient as an illustration of the use of a 2-D array for the implementation of the game of Life. But a full implementation should allow for an in_nite-sized grid. Implement the Sparse Life Grid ADT using an approach similar to the one used to implement the sparse matrix. SparseLifeGrid(): Creates a new in_nite-sized game grid. All cells in the grid are initially set to dead.
_ minRange(): Returns a 2-tuple (minrow, mincol) that contains the mini- mum row index and the minimum column index that is currently occupied by a live cell.
_ maxRange(): Returns a 2-tuple (maxrow, maxcol) that contains the maxi- mum row index and the maximum column index that is currently occupied by a live cell.
_ configure( coordList ): Con_gures the grid for evolving the _rst gen- eration. The coordList argument is a sequence of 2-tuples with each tuple representing the coordinates (r; c) of the cells to be set as alive. All remaining cells are cleared or set to dead.
_ clearCell( row, col ): Clears the individual cell (row, col) and sets it to dead. The cell indices must be within the valid range of the grid.
_ setCell( row, col ): Sets the indicated cell (row, col) to be alive. The cell indices must be within the valid range of the grid.
_ isLiveCell( row,col ): Returns a boolean value indicating if the given cell (row, col) contains a live organism. The cell indices must be within the valid range of the grid.
_ numLiveNeighbors( row, col ): Returns the number of live neighbors for the given cell (row, col). The neighbors of a cell include all of the cells immediately surrounding it in all directions. For the cells along the border of the grid, the neighbors that fall outside the grid are assumed to be dead. The cell indices must be within the valid range of the grid.