| Preface |
|
ix | |
| Chapter Dependency Chart |
|
xi | |
|
PART ONE Problem-Solving Techniques |
|
|
1 | (282) |
|
Principles of Programming and Software Engineering |
|
|
3 | (62) |
|
Software Engineering and Object-Oriented Design |
|
|
4 | (20) |
|
An Examination of Problem Solving |
|
|
4 | (1) |
|
Aspects of an Object-Oriented Solution |
|
|
4 | (1) |
|
Abstraction and Information Hiding |
|
|
5 | (2) |
|
Principles of Object-Oriented Programming |
|
|
7 | (1) |
|
Object-Oriented Analysis and Design |
|
|
8 | (1) |
|
Applying the UML to OOA/D |
|
|
9 | (10) |
|
|
|
19 | (1) |
|
Iterative and Evolutionary Development |
|
|
19 | (1) |
|
Rational Unified Process Development Phases |
|
|
20 | (3) |
|
What About the Waterfall Method of Development? |
|
|
23 | (1) |
|
Achieving a Better Solution |
|
|
24 | (10) |
|
Evaluation of Designs and Solutions |
|
|
24 | (3) |
|
|
|
27 | (2) |
|
|
|
29 | (3) |
|
|
|
32 | (2) |
|
Key Issues in Programming |
|
|
34 | (31) |
|
|
|
35 | (1) |
|
|
|
36 | (9) |
|
|
|
45 | (2) |
|
|
|
47 | (1) |
|
|
|
48 | (5) |
|
|
|
53 | (2) |
|
|
|
55 | (10) |
|
|
|
65 | (56) |
|
|
|
66 | (19) |
|
A Recursive Valued Function: The Factorial of n |
|
|
69 | (7) |
|
A Recursive void Function: Writing a String Backward |
|
|
76 | (9) |
|
|
|
85 | (8) |
|
Multiplying Rabbits (The Fibonacci Sequence) |
|
|
85 | (2) |
|
|
|
87 | (3) |
|
Mr. Spock's Dilemma (Choosing k Out of n Things) |
|
|
90 | (3) |
|
|
|
93 | (9) |
|
Finding the Largest Item in an Array |
|
|
93 | (1) |
|
|
|
94 | (4) |
|
Finding the kth Smallest Item of an Array |
|
|
98 | (4) |
|
|
|
102 | (4) |
|
|
|
102 | (4) |
|
|
|
106 | (15) |
|
Data Abstraction: The Walls |
|
|
121 | (50) |
|
|
|
122 | (5) |
|
|
|
127 | (14) |
|
|
|
128 | (5) |
|
|
|
133 | (1) |
|
|
|
134 | (5) |
|
|
|
139 | (2) |
|
|
|
141 | (30) |
|
|
|
143 | (9) |
|
|
|
152 | (2) |
|
An Array-Based Implementation of the ADT List |
|
|
154 | (6) |
|
|
|
160 | (2) |
|
An Implementation of the ADT List Using Exceptions |
|
|
162 | (9) |
|
|
|
171 | (76) |
|
|
|
172 | (12) |
|
|
|
173 | (7) |
|
Dynamic Allocation of Arrays |
|
|
180 | (2) |
|
Pointer-Based Linked Lists |
|
|
182 | (2) |
|
Programming with Linked Lists |
|
|
184 | (31) |
|
Displaying the Contents of a Linked List |
|
|
184 | (2) |
|
Deleting a Specified Node from a Linked List |
|
|
186 | (3) |
|
Inserting a Node into a Specified Position of a Linked List |
|
|
189 | (5) |
|
A Pointer-Based Implementation of the ADT List |
|
|
194 | (8) |
|
Comparing Array-Based and Pointer-Based Implementations |
|
|
202 | (3) |
|
Saving and Restoring a Linked List by Using a File |
|
|
205 | (3) |
|
Passing a Linked List to a Method |
|
|
208 | (1) |
|
Processing Linked Lists Recursively |
|
|
209 | (5) |
|
Objects as Linked List Data |
|
|
214 | (1) |
|
Variations of the Linked List |
|
|
215 | (6) |
|
|
|
216 | (1) |
|
|
|
217 | (1) |
|
|
|
218 | (3) |
|
Application: Maintaining an Inventory |
|
|
221 | (6) |
|
The C++ Standard Template Library |
|
|
227 | (20) |
|
|
|
228 | (1) |
|
|
|
229 | (1) |
|
The Standard Template Library Class list |
|
|
230 | (17) |
|
Recursion as a Problem-Solving Technique |
|
|
247 | (36) |
|
|
|
248 | (8) |
|
|
|
248 | (2) |
|
Implementing Eight Queens Using the STL Class vector |
|
|
250 | (6) |
|
|
|
256 | (14) |
|
|
|
256 | (2) |
|
|
|
258 | (2) |
|
|
|
260 | (10) |
|
The Relationship Between Recursion and Mathematical Induction |
|
|
270 | (13) |
|
The Correctness of the Recursive Factorial Function |
|
|
270 | (1) |
|
The Cost of Towers of Hanoi |
|
|
271 | (12) |
|
PART TWO Problem Solving with Abstract Data Types |
|
|
283 | (524) |
|
|
|
285 | (58) |
|
The Abstract Data Type Stack |
|
|
286 | (6) |
|
Developing an ADT During the Design of a Solution |
|
|
286 | (6) |
|
Simple Applications of the ADT Stack |
|
|
292 | (4) |
|
Checking for Balanced Braces |
|
|
292 | (2) |
|
Recognizing Strings in a Language |
|
|
294 | (2) |
|
Implementations of the ADT Stack |
|
|
296 | (15) |
|
An Array-Based Implementation of the ADT Stack |
|
|
297 | (4) |
|
A Pointer-Based Implementation of the ADT Stack |
|
|
301 | (4) |
|
An Implementation That Uses the ADT List |
|
|
305 | (3) |
|
Comparing Implementations |
|
|
308 | (1) |
|
The Standard Template Library Class stack |
|
|
309 | (2) |
|
Application: Algebraic Expressions |
|
|
311 | (5) |
|
Evaluating Postfix Expressions |
|
|
311 | (2) |
|
Converting Infix Expressions to Equivalent Postfix Expressions |
|
|
313 | (3) |
|
Application: A Search Problem |
|
|
316 | (13) |
|
A Nonrecursive Solution That Uses a Stack |
|
|
317 | (10) |
|
|
|
327 | (2) |
|
The Relationship Between Stacks and Recursion |
|
|
329 | (14) |
|
|
|
343 | (44) |
|
The Abstract Data Type Queue |
|
|
344 | (2) |
|
Simple Applications of the ADT Queue |
|
|
346 | (2) |
|
Reading a String of Characters |
|
|
346 | (1) |
|
|
|
347 | (1) |
|
Implementations of the ADT Queue |
|
|
348 | (20) |
|
A Pointer-Based Implementation |
|
|
349 | (5) |
|
An Array-Based Implementation |
|
|
354 | (7) |
|
An Implementation That Uses the ADT List |
|
|
361 | (3) |
|
The Standard Template Library Class queue |
|
|
364 | (3) |
|
Comparing Implementations |
|
|
367 | (1) |
|
A Summary of Position-Oriented ADTs |
|
|
368 | (1) |
|
|
|
369 | (18) |
|
|
|
387 | (58) |
|
|
|
388 | (10) |
|
Public, Private, and Protected Inheritance |
|
|
395 | (1) |
|
Is-a, Has-a, and As-a Relationships |
|
|
395 | (3) |
|
Virtual Methods and Late Binding |
|
|
398 | (10) |
|
|
|
404 | (4) |
|
|
|
408 | (3) |
|
The ADTs List and Sorted List Revisited |
|
|
411 | (8) |
|
Implementations of the ADT Sorted List That Use the ADT List |
|
|
413 | (6) |
|
|
|
419 | (7) |
|
|
|
426 | (5) |
|
|
|
431 | (14) |
|
Implementing the ADT List Using Iterators |
|
|
433 | (12) |
|
Algorithm Efficiency and Sorting |
|
|
445 | (54) |
|
Measuring the Efficiency of Algorithms |
|
|
446 | (12) |
|
The Execution Time of Algorithms |
|
|
447 | (1) |
|
|
|
448 | (2) |
|
Order-of-Magnitude Analysis and Big O Notation |
|
|
450 | (4) |
|
|
|
454 | (2) |
|
The Efficiency of Searching Algorithms |
|
|
456 | (2) |
|
Sorting Algorithms and Their Efficiency |
|
|
458 | (41) |
|
|
|
459 | (3) |
|
|
|
462 | (2) |
|
|
|
464 | (2) |
|
|
|
466 | (6) |
|
|
|
472 | (12) |
|
|
|
484 | (2) |
|
A Comparison of Sorting Algorithms |
|
|
486 | (1) |
|
The Standard Template LibrarySorting Algorithms |
|
|
487 | (12) |
|
|
|
499 | (90) |
|
|
|
500 | (8) |
|
|
|
508 | (28) |
|
Traversals of a Binary Tree |
|
|
512 | (3) |
|
Possible Representations of a Binary Tree |
|
|
515 | (4) |
|
A Pointer-Based Implementation of the ADT Binary Tree |
|
|
519 | (17) |
|
The ADT Binary Search Tree |
|
|
536 | (39) |
|
Algorithms for the ADT Binary Search Tree Operations |
|
|
539 | (16) |
|
A Pointer-Based Implementation of the ADT Binary Search Tree |
|
|
555 | (9) |
|
The Efficiency of Binary Search Tree Operations |
|
|
564 | (4) |
|
|
|
568 | (1) |
|
Saving a Binary Search Tree in a File |
|
|
569 | (3) |
|
The STL Search Algorithms |
|
|
572 | (3) |
|
|
|
575 | (14) |
|
Tables and Priority Queues |
|
|
589 | (60) |
|
|
|
590 | (20) |
|
Selecting an Implementation |
|
|
595 | (7) |
|
A Sorted Array-Based Implementation of the ADT Table |
|
|
602 | (5) |
|
A Binary Search Tree Implementation of the ADT Table |
|
|
607 | (3) |
|
The ADT Priority Queue: A Variation of the ADT Table |
|
|
610 | (20) |
|
|
|
614 | (9) |
|
A Heap Implementation of the ADT Priority Queue |
|
|
623 | (3) |
|
|
|
626 | (4) |
|
Tables and Priority Queues in the STL |
|
|
630 | (19) |
|
The STL Associative Containers |
|
|
630 | (8) |
|
The STL priority_queue Class and Heap Algorithms |
|
|
638 | (11) |
|
Advanced Implementations of Tables |
|
|
649 | (72) |
|
|
|
650 | (36) |
|
|
|
651 | (19) |
|
|
|
670 | (8) |
|
|
|
678 | (3) |
|
|
|
681 | (5) |
|
|
|
686 | (24) |
|
|
|
690 | (3) |
|
|
|
693 | (8) |
|
The Efficiency of Hashing |
|
|
701 | (3) |
|
What Constitutes a Good Hash Function? |
|
|
704 | (2) |
|
Table Traversal: An Inefficient Operation Under Hashing |
|
|
706 | (1) |
|
Implementing a HashMap Class Using the STL |
|
|
707 | (3) |
|
Data with Multiple Organizations |
|
|
710 | (11) |
|
|
|
721 | (44) |
|
|
|
722 | (3) |
|
|
|
725 | (7) |
|
|
|
726 | (3) |
|
Implementing a Graph Class Using the STL |
|
|
729 | (3) |
|
|
|
732 | (8) |
|
|
|
733 | (3) |
|
|
|
736 | (1) |
|
Implementing a BFS Class Using the STL |
|
|
737 | (3) |
|
|
|
740 | (25) |
|
|
|
740 | (3) |
|
|
|
743 | (4) |
|
|
|
747 | (2) |
|
|
|
749 | (5) |
|
|
|
754 | (2) |
|
|
|
756 | (9) |
|
Processing Data in External Storage |
|
|
765 | (42) |
|
A Look at External Storage |
|
|
766 | (3) |
|
Sorting Data in an External File |
|
|
769 | (7) |
|
|
|
776 | (31) |
|
Indexing an External File |
|
|
779 | (4) |
|
|
|
783 | (4) |
|
|
|
787 | (10) |
|
|
|
797 | (2) |
|
|
|
799 | (8) |
| Review of C++ Fundamentals |
|
807 | (73) |
| ASCII Character Codes |
|
880 | (1) |
| C++ Header Files and Standard Functions |
|
881 | (6) |
| Mathematical Induction |
|
887 | (6) |
| Standard Template Library |
|
893 | (12) |
| C++ Documentation Systems |
|
905 | (4) |
| Glossary |
|
909 | (26) |
| Answers to Self-Test Exercises |
|
935 | (18) |
| Index |
|
953 | |