General Trees

Table of contents:

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.


Part I: Object-Oriented Programming

Encapsulation

Polymorphism

Inheritance

Part II: Linear Structures

Stacks and Queues

Array-Based Structures

Linked Structures

Part III: Algorithms

Analysis of Algorithms

Searching and Sorting

Recursion

Part IV: Trees and Sets

Trees

Sets

Part V: Advanced Topics

Advanced Linear Structures

Strings

Advanced Trees

Graphs

Memory Management

Out to the Disk

Part VI: Appendices

A. Review of Java

B. Unified Modeling Language

C. Summation Formulae

D. Further Reading

Index



Data Structures and Algorithms in Java
Data Structures and Algorithms in Java
ISBN: 0131469142
EAN: 2147483647
Year: 2004
Pages: 216
Authors: Peter Drake

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net