How to convert the code below from using vectors tostore/retrieve information to using hashtables to store/retrieveinformation? (instead of using vectors, use hash tables).
void Board::checkNeighbors(int x, int y) {
vector<NeighbourCell> neighbours;
int totalValue = 0;
int tv1 = 0;
int tv2 = 0;
int tv3 = 0;
int tv4 = 0;
if (x>0 && grid[x-1][y] != 0) {
NeighbourCell nc;
nc.direction = “UP:”;
nc.pipCount = grid[x-1][y];
neighbours.push_back(nc);
//cout << “UP: ” << nc.direction << endl;
tv1 = nc.pipCount;
}
if (x<row-1 && grid[x+1][y] != 0) {
NeighbourCell nc;
nc.direction = “DOWN:”;
nc.pipCount = grid[x+1][y];
neighbours.push_back(nc);
///cout << “DOWN: ” << nc.direction <<endl;
tv2 = nc.pipCount;
}
if (y>0 && grid[x][y-1] != 0) {
NeighbourCell nc;
nc.direction = “LEFT:”;
nc.pipCount = grid[x][y-1];
neighbours.push_back(nc);
//cout << “LEFT: ” << nc.direction <<endl;
tv3
PayPal Gateway not configured
PayPal Gateway not configured