Data Abstraction and Problem Solving with Java

Frank M. Carrano, Janet Prichard

  • 出版商: Addison Wesley
  • 出版日期: 2000-07-19
  • 售價: $980
  • 貴賓價: 9.8$960
  • 語言: 英文
  • 頁數: 806
  • 裝訂: Hardcover
  • ISBN: 0201702207
  • ISBN-13: 9780201702200
  • 相關分類: Java 程式語言






This book is based on the classic "Walls and Mirrors" approach used in the best-selling Data Abstraction and Problem Solving with C++, and is now updated to the Java programming language. It uses the running theme of "Walls and Mirrors" to help make clear the challenging concepts of recursion (the mirrors) and data abstraction (the walls). Authors Carrano and Prichard cover key object-oriented concepts, including encapsulation, inheritance, and polymorphism. However, the focus of the book remains on data abstraction.

Back to Top

Appropriate Courses

Java Data Structures/CS2.

Back to Top


  • Provides a firm foundation in data abstraction (the walls), emphasizing the distinction between specification and implementation as the foundation for the object-oriented approach. Pg.__
  • Offers extensive coverage of recursion (the mirrors) and uses the technique throughout many examples and exercises. Pg.__
  • Introduces analysis of algorithms and Big "O" notation. Pg.__
  • Provides an appendix covering basic Java syntax for those who know a different language or who need a refresher. Pg.__
  • Contains many pedagogical study aids such as margin notes, cautionary warnings about common errors, programming projects, specifications for all major ADTs in both English and pseudecode, and self-test exercises with answers. Pg.__
  • A proven approach, adapted from the best selling Data Abstraction and Problem Solving with C++. Pg.__
Back to Top

Table Of Contents

(NOTE: Each chapter concludes with a Summary, Cautions, Self-Test Exercises, Exercises and Programming Problems.)


1. Principles of Programming and Software Engineering.
Problem Solving and Software Engineering.
What Is Problem Solving.
The Life Cycle of Software.
What Is a Good Solution.

Achieving a Modular Design.
Abstraction and Information Hiding.
Object-Oriented Design.
Top-Down Design.
General Design Guidelines.

A Summary of Key Issues in Programming.
Ease of Use.
Fail-Safe Programming.

2. Recursion: The Mirrors.
Recursive Solutions.
A Recursive Valued Method: The Factorial of n.
A Recursive Void Method: Writing a String Backward.

Counting Things.
Multiplying Rabbits (The Fibonacci Sequence).
Organizing a Parade.
Mr. Spock's Dilemma (Choosing k out of n Things).

Searching an Array.
Finding the Largest Item in an Array.
Binary Search.
Finding the kth Smallest Item of an Array.

Organizing Data.
The Towers of Hanoi.

Recursion and Efficiency.

3. Data Abstraction: The Walls.
Abstract Data Types.
Specifying ADTs.
The ADT List.
The ADT Sorted List.
Designing an ADT.
Axioms (Optional).

Implementing ADTs.
Java Classes.
Java Interfaces.
Java Exceptions.
An Array-Based Implementation of the ADT List.

4. Linked Lists.
Object References.
Resizeable Arrays.
Reference-Based Linked Lists.

Programming with Linked Lists.
Displaying the Contents of a Linked List.
Deleting a Specified Node from a Linked List.
Inserting a Node into a Specified Position of a Linked List.
A Reference-Based Implementation of the ADT List.
Comparing Array-Based and Reference-Based Implementations.
Passing a Linked List to a Method.
Processing Linked Lists Recursively.

Variations of the Linked List.
Tail References.
Circular Linked Lists.
Dummy Head Nodes.
Doubly Linked Lists.

Application: Maintaining an Inventory.

5. Recursion as a Problem-Solving Technique.
The Eight Queens Problem.

Defining Languages.
The Basics of Grammars.
Two Simple Languages.
Algebraic Expressions.

The Relationship Between Recursion and Mathematical Induction.
The Correctness of the Recursive Factorial Method.
The Cost of Towers of Hanoi.


6. Stacks.
The Abstract Data Type Stack.
Developing an ADT During the Design of a Solution.

Simple Applications of the ADT Stack.
Checking for Balanced Braces.
Recognizing Strings in a Language.

Implementations of the ADT Stack.
An Array-Based Implementation of the ADT Stack.
A Reference-Based Implementation of the ADT Stack.
An Implementation That Uses the ADT List.
Comparing Implementations.

Application: Algebraic Expressions.
Evaluating Postfix Expressions.
Converting Infix Expressions to Equivalent Postfix Expressions.

Application: A Search Problem.
A Nonrecursive Solution That Uses a Stack.
A Recursive Solution.

The Relationship Between Stacks and Recursion.

7. Queues.
The Abstract Data Type Queue.
Simple Applications of the ADT Queue.
Reading a String of Characters.
Recognizing Palindromes.

Implementations of the ADT Queue.
A Reference-Based Implementation.
An Array-Based Implementation.
An Implementation That Uses the ADT List.
Comparing Implementations.

A Summary of Position-Oriented ADTs.
Application: Simulation.

8. Class Relationships.
Inheritance Revisited.
Java Packages.
Java Access Modifiers.
Is-a and Has-a Relationships.

Dynamic Binding and Abstract Classes.
Abstract Classes.
Java Interfaces Revisited (Iterators).

The ADTs LIST and Sorted List Revisited.
Implementations of A List Iterator.
Implementations of the ADT Sorted List That Use the ADT List.

The Advantages of an Object-Oriented Approach.

9. Algorithm Efficiency and Sorting.
Determining the Efficiency of Algorithms.
The Execution Time of Algorithms.
Algorithm Growth Rates.
Order-of-Magnitude Analysis and Big O Notation.
Keeping Your Perspective.
The Efficiency of Searching Algorithms.

Sorting Algorithms and Their Efficiency.
Selection Sort.
Bubble Sort.
Insertion Sort.
Radix Sort.
A Comparison of Sorting Algorithms.

10. Trees.
The ADT Binary Tree.
Basic Operations of the ADT Binary Tree .
General Operations of the ADT Binary Tree.
Traversals of a Binary Tree.
Possible Representations of a Binary Tree.
A Reference-Based Implementation of the ADT Binary Tree.
Tree Traversals Using an Iterator.

The ADT Binary Search Tree.
Algorithms for the Operations of the ADT Binary Search Tree.
A Reference-Based Implementation of the ADT Binary Search Tree.
The Efficiency of Binary Search Tree Operations.
Saving a Binary Search Tree in a File.

General Trees.

11. Tables and Priority Queues.
The ADT Table.
Selecting an Implementation.
A Sorted Array-Based Implementation of the ADT Table.
A Binary Search Tree Implementation of the ADT Table.

The ADT Priority Queue: A Variation of the ADT Table.
A Heap Implementation of the ADT Priority Queue.

12. Advanced Implementation of Tables.
Balanced Search Trees.
2-3 Trees.
2-3-4 Trees.
Red-Black Trees.
AVL Trees.

Hash Functions.
Resolving Collisions.
The Efficiency of Hashing.
What Constitutes a Good Hash Function?
Table Traversal: An Inefficient Operation Under Hashing.

Data with Multiple Organizations.

13. Graphs.
Graphs as ADTs.
Implementing Graphs.

Graph Traversals.
Depth-First Search.
Breadth-First Search.

Applications of Graphs.
Topological Sorting.
Spanning Trees.
Minimum Spanning Trees.
Shortest Paths.
Some Difficult Problems.

14. External Methods.
A Look at External Storage.
Sorting Data in an External File.
External Tables.
Indexing an External File.
External Hashing.
Multiple Indexing.

Appendix A: Review of Java Fundamentals.
Program Structure.
Data Fields.
How to Access Members of an Object.

Language Basics.
Identifiers and Keywords.
Primitive Data Types.
Literal Constants.
Named Constants.
Assignments and Expressions.

Useful Java Classes.
The Object Class.
String Classes.

Java Exceptions.
Catching Exceptions.
Throwing Exceptions.

Text Input and Output.

Selection Statements.
The if Statement.
The switch Statement.

Iteration Statements.
The while Statement.
The for Statement.
The do Statement.

File Input and Output.
Text Files.
Object Serialization.

A Comparison to C++.

Appendix B: Unicode Character Codes (ASCII Subset)..
Appendix C: Java Resources.
Appendix D: Mathematical Induction.
Answers to Self-Test Exercises.

Back to Top


Instructor Supplements

For more information about any of the supplements listed below, use our Rep. Locator to contact your Addison Wesley representative.

  • Online Instructor's Manual with Solutions

Back to Top