// file: ht_get_2.cc
//

// isip include files
//
#include "hash_table.h"
#include "hash_table_constants.h"
 
// method: get_num_cells_cc
//
// arguments: none
//
// return: an integer giving the number of cells in the table
//
// this method gets the number of cells in the hash table
//
int_4 Hash_table::get_num_cells_cc() {

  // declare local variables
  //
  int_4 num_items = 0;
  
  // get cells of hash table and exit gracefully
  //
  for (int_4 i = 0; i < size_d; i++) {
    Hash_cell* cell = cells_d[i];
    while (cell != (Hash_cell*)NULL) {
      num_items++;
      cell = cell->get_next_cc();
    }
  }

  // exit gracefully
  //
  return num_items;
}
