Question: A 4 by 4 tic - tac - toe board is an 2 - dimensional array of char in which each element is either an

A 4 by 4 tic-tac-toe board is an 2-dimensional array of char in which each element is either an 'X','O' or '-
'. The game is like normal tic-tac-toe but the players may keep playing even after someone has three in a row. After the board is full, the winner is whichever player with the most "threes in a row".
a) Calculate n= the number of possible boards, without regard for the rules of tic-tac-toe. For example we'll include boards with 5 X's and 2 O's even though no such board could occur in an actual game.
b) In C++, write a perfect minimal hash function hash1 that maps each board to a unique value between 0 and n-1(provided tableSize n), where n is your value from Part a.
unsigned int hash1(char board[4][], unsigned int tableSize);
 A 4 by 4 tic-tac-toe board is an 2-dimensional array of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!