An Introduction to Object-Oriented Programming

By Timothy Budd

Study Guide for Chapter 5


Learning Objectives

After reading this chapter, you should be able to:

Study Questions

You may wish to use the print or save as command on your web browser to produce a copy of this study guide. That way you can fill in the answers to the questions as part of your assimilating the information you learn as you read the material.
  1. What does it mean to say that in the solutions to the eight queens problem presented here, that the pieces themselves find the solution?

  2. Explain what it means to say a problem is being solved using the technique of ``generate and test''. What portions of the behavior we have assigned to the class Queen are involved in generation, and what portions or involved in testing?

  3. In the C++ solution the leftmost queen holds a null pointer value in its neighbor field, whereas the solution in Objective-C uses a sentinel value. What are the benefits of the use of the sentinel?

  4. How does an active sentinel object differ from a simple endmarker value? (An endmarker being a special value used to mark the end of a list).

Contents copyright Timothy Budd, 1995.