General Trees
Projects
10.24 |
Add methods preorderIterator() and levelOrderIterator() to the BinaryNode class. Each should return an Iterator which traverses the tree in the specified order. (Hint: Define two new classes, each implementing the Iterator interface. Each class needs a field of type Stack or Queue.) |
10.25 |
Modify the Tic Tac Toe program so that it looks ahead only a certain number of moves. This number should be passed in to the constructor as an argument maxDepth. Run a tournament between players with max depths of 1, 3, 5, 7, and 9. Explain whether searching deeper produces a better player. |
10.26 |
Write a minimax player for the Mancala game from Project 2.33. For the program to take its turn in a reasonable amount of time, you will need to implement limited depth as in Project 10.25. Notice that in Mancala a move by one player is sometimes followed by another move by the same player. |