Question 6: Sparse Tables [10]

Study the definition of the sparse table class below, then provide an implementation of the destructor. (If you make any assumptions be sure to clearly state them.)

class sparsetable {
   private:
      struct node {
         node *up, *down, *left, *right;
         int  row, col;
         string data;
      };
      node *RowPtrs[MaxRows]; 
      node *ColPtrs[MaxCols]; 
      int numrows, numcols;
      node *search(int r, int c);

   public:
      sparsetable();
      ~sparsetable();
      bool insert(int r, int c, float d);
      bool search(int r, int c, float &d);
      bool remove(int r, int c);
      void print();
};