Home > Store > Programming > C/C++

Data Structures with C++ Using STL, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

Data Structures with C++ Using STL, 2nd Edition


  • Your Price: $175.78
  • List Price: $206.80
  • Usually ships in 24 hours.



  • NEW - Data structures presented using the model of the Standard Template Library (STL)—Over the course of the book, student master the use and implementation of the STL container classes.
    • Teaches students the modern approach to data structures. Ex.___

  • NEW - Simple algorithms integrated throughout the text.
    • Includes an applied study of interesting and classical algorithms that illustrate the data structures using only simple mathematical concepts. (Big-O notation is introduced intuitively). Ex.___

  • NEW - Many additional figures integrated into the presentation.
    • Lead students through the concepts. Ex.___

  • NEW - ADT (Abstract Data Type) for each data structure—Immediately used to solve appropriate problems.
    • Book provides students with many examples before presenting the corresponding implementation so that students see a data structure unfold and are then able to trace back through the examples when looking at the implementation. Ex.___

  • NEW - Early and accessible introduction to templates and iterators.
    • Allows students to understand and use powerful abstractions available in modern data structures. Ex.___

  • NEW - Later chapters (Chapters 11 - 17) supplement the CS2 course.
    • Appropriate material for an advanced data structures and algorithms course. Ex.___

  • Use of modern C++ constructs in developing data structures and their applications—Provides enough language detail to sufficiently understand the constructs. A fuller explanation of language details available on the Companion Website.
    • Reflects the type of data structures that students would use in the real world. Ex.___

  • Extensive pedagogy—Includes many complete programs with output, case studies, review exercises with solutions, extensive written exercises and programming exercises, programming projects, and glossary of key terms.
    • Helps students learn, review, and retain material. Ex.___


  • Copyright 2002
  • Dimensions: 7-1/2" x 9-1/4"
  • Pages: 1039
  • Edition: 2nd
  • Book
  • ISBN-10: 0-13-085850-1
  • ISBN-13: 978-0-13-085850-4

This long-awaited second edition of Data Structures with C++ Using STL, by Professors Ford and Topp, provides a modern object-oriented approach to data structures using the model of the Standard Template Library (STL). The authors unify the study of data structures around the concepts of containers and iterators. The book skillfully develops algorithms for the data structures and their applications. Readers will find a systematic and detailed implementation for each data structure. These successful authors offer a learning tool that is motivated by a wealth of excellent examples and complete running programs.


  • Uses the early chapters to present object design and programming principles that are at the core of data structures.
  • Develops clear and concise templates, which can support generic programming throughout the book.
  • Uses the STL container classes throughout the book.
  • Presents an Application Programming Interface (API) for each STL container and immediately uses it to solve problems.
  • Demonstrates the implementation of the STL classes by developing mini-container classes that use the corresponding STL interface. The student can understand the overall design of the container and its C++ implementation code.
  • Includes and intuitive and precise introduction to iterators that are at the core of modern data structures.
  • Covers with the same careful style advanced topics such as red-black trees, hash tables, heaps, and graphs.
  • Provides the reader with an extensive development of advanced recursion and inheritance as applied to data structures.
  • Makes available valuable pedagogical features including chapter objectives and summaries; many complete programs with runtime output; case studies; review exercises with solutions for each chapter; extensive written and programming exercises; and a programming project for each chapter.
  • Supplement: Instructor CD with solutions and a test item file; Companion Website containing language tutorials, students assessment materials, and PowerPoint slides.

Sample Content

Table of Contents

(Most chapters end with Chapter Summary, Classes and Libraries in the Chapter, Review Exercises, Written Exercises, Programming Exercises and Programming Projects.)


1. Introduction to Data Structures.

What is this Book About? Abstract View of Data Structures. An ADT as a Class. Implementing C++ Classes. Declaring and Using Objects. Implementing a Class with Inline Code. Application Programming Interface(API). Strings.

2. Object Design Techniques.

Software Design. Handling Runtime Errors. Object Composition. Operator Overloading.

3. Introduction to Algorithms.

Selection Sort. Simple Search Algorithms. Analysis of Algorithms. Analyzing the Search Algorithms. Making Algorithms Generic. The Concept of Recursion. Problem Solving with Recursion.

4. The Vector Container.

Overview of STL Container Classes. Template Classes. The Vector Class. Vector Applications.

5. Pointers and Dynamic Memory.

C++ Pointers. Dynamic Memory. Classes Using Dynamic Memory. Assignment and Initialization. The Minivector Class. The Matrix Class.

6. The List Container and Iterators.

The List Container. Iterators. General List Insert And Erase Operations. Case Study: Graduation Lists.

7. Stacks.

The Stack ADT. Recursive Code and the Runtime Stack. Stack Implementation. Postfix Expressions. Case Study: Infix Expression Evaluation.

8. Queues and Priority Queues.

The Queue ADT. The Radix Sort. Implementing the Miniqueue Class. Case Study: Time-Driven Simulation. Array Based Queue Implementation. Priority Queues.

9. Linked Lists.

Linked List Nodes. Building Linked Lists. Handling The Back of the List. Implementing a Linked Queue. Doubly Linked Lists. Updating A Doubly Linked List. The Josephus Problem. The Minilist Class. Selecting a Sequence Container.

10.Binary Trees.

Tree Structures. Binary Tree Nodes. Binary Tree Scan Algorithms. Using Tree Scan Algorithms. Binary Search Trees. Using Binary Search Trees. Implementing the Stree Class. The Stree Iterator (Optional).

11. Associative Containers.

Overview of Associative Containers. Sets. Maps. Multisets. Implementing Sets And Maps.

12. Advanced Associative Structures.

Hashing. Designing Hash Functions. Designing Hash Tables. The Hash Class. Hash Table Performance. 2-3-4 Trees. Red-Black Trees. The Rbtree Class.

13. Inheritance and Abstract Classes.

Inheritance in C++. The Graphics Hierarchy. The Graphics System. Safe Vectors. Ordered Lists. Polymorphism and Virtual Functions. Abstract Classes.

14. Heaps Binary Files and Bit Sets.

Array Based Binary Trees. Heaps. Implementing a Priority Queue. Binary Files. Bitsets. Case Study: Huffman Compression.

15. Recursive Algorithms.

Divide and Conquer Algorithms. Combinatorics. Dynamic Programming. Backtracking: The Eight-Queens Problem.

16. Graphs.

Graph Terminology. The Graph Class. Graph Class Design. Graph Traversal Algorithms. Graph Traversal Applications. Graph Minimization Algorithms.




This book is designed to present the fundamentals of data structures from an object-oriented perspective. The focus is on data structures that efficiently store large collections of data. The structures, called containers, feature operations to access, insert, and remove items from the collection. The study of data structures is core to a computer science curriculum. This curriculum has had a rich and storied tradition. Computer researchers and practitioners have evolved a wide range of container structures to meet different problem situations. Initially, the focus was on implementation issues so that programs could efficiently store and access large data sets within the limited physical resources of the computer system. As computers developed greater CPU power and increased memory and storage capabilities, researchers and practitioners were free to give more consideration to the abstract design of the containers. The efforts were greatly aided by an emerging emphasis on object-oriented programming. Object technology provides a means of viewing containers as objects with designated operations to handle the data. A class declaration defines the structure of a container. The public member functions describe a programming interface that allows a container to be used in applications.

Researchers at AT&T Bell Laboratories and Hewlett-Packard Research Labs combined the principles of generic and object-oriented programming to create a unified approach to the study of data structures and algorithms. The result is the Standard Template Library (STL), which is now part of the standard C++ library. STL provides a modern approach to data structures. It categories the structures as sequence and associative containers, along with adapter classes. By using templates rd iterators, the STL library allows a programmer to execute a broad range of algorithms that apply to each of the container classes.

This is, however, not a book on STL. It draws on the design structure of STL to date a unifying study of data structures. The reader will be introduced to the basics of STL and become familiar with the essential elements of the library. The result will be an appreciation of the power, simplicity, and usefulness of STL. With this background, the reader can easily read a technical book on STL to learn more of its many features. While this book is designed as a textbook, a computer professional could use it as a self-study guide to data structures.

Approach to Data Structures

This book uses a very careful and systematic approach in the development of each data structure. The reader first views a structure informally as an ADT that provides a description of how the container stores elements. Text, figures, and examples provide a detailed understanding of the key operations for the data structure, without reference to any implementation. The reader is then introduced to a second view of the structure using a formal C++ class declaration or an API. The latter refers to an Application Programming Interface format that is the industry-wide standard for presenting class operations. The API format includes the function prototype, a description of its action, and a listing of its preconditions and postconditions. We use the API format to describe the STL container classes and the class declaration to describe the other data structures that are developed in the book.

Once the reader is familiar with a formal representation of a data structure, the book provides a series of applications, which illustrate problem-solving situations that effectively use the structure. Having the reader understand the implementation of a data structure is a key feature of the book. Corresponding to each STL container class, the book presents a "mini Container" class that uses the STL interface but offers a straight forward implementation of the operations. The text clearly presents the design and coding of the key operations. The supplemental software supplies a complete listing of the class, with well-documented code.

Ins and Outs of the Book

This book assumes the reader has completed a first course in C++ object-oriented programming. The authors assume that the concepts of object composition, operator overloading, pointers and dynamic memory, and inheritance are covered briefly, if at all, in a first course. These concepts are carefully developed in this book in the context of their application to data structures. Periodically the book introduces only the essentials of a programming concept, and makes available a Web Tutorial that develops the concept in greater depth. The tutorials include examples and programs and provide the reader with enrichment that is not critical to understanding the text. The existence of a tutorial is clearly marked with an icon in the margin.

Chapters 1 through 10 cover sequence containers (array, vector, list, deque), the adapter classes (stacks, queues, and priority queues), and an introduction to associative tree containers. The material, along with a development of pointers, dynamic memory, and linked lists contains the topics usually covered in a first course in data structures (CS2).

Chapters 11 through 16 introduce more advanced containers that include sets, maps, balanced trees, heaps, hash tables and graphs. The chapters also include a study of applied searching and sorting algorithms, advanced recursion, and graph algorithms. The material is appropriate for a follow-up course in advanced data structures and applied algorithms (CS7).

Supplemental Resources

Readers may access the complete source code listings for all classes and programs in the book from the authors' website at http://www.uop.edu/fordtopp or http://www.fordtopp.com, and from Prentice Hall at http://www.prenhall.com. The C++ source code has been tested and run in the Windows environment using Microsoft Visual C++ and Borland C++ Builder, and in the UNIX environment using GNU C++. The graphics library is implemented in each of these environments.

To successfully compile and run the programs in the book using the Microsoft Visual C++,6.0 compiler, the reader must install the latest Service Pack. Instructions for obtaining and loading the service pack are available on the authors' and Prentice Hall web sites. The same sites include the Web tutorials and Powerpoint slides that present the key topics from each chapter.

An Instructor's Resource CD (IRCD) is available to instructors and provides answers to all of the written exercises and a solution to all of the programming exercises and programming projects. The IRCD also has sample tests with 'questions in a variety of formats. All of these elements are provided in Word for` mat (".doc") to enable the selection and modification of individual items. For printing only, the IRCD also supplies the materials in Acrobat Reader (".pdf") and postscript (".ps") format. In addition, it provides individual source files of all the programs (*.cpp) and classes (*.h) that are developed in the exercises. The IRCD is available upon request by Professors and Instructors from your local Prentice Hall sales representative.


The authors have been supported by friends, students, and colleagues throughout he preparation of the second edition of Data Structures with C++ using STL. The University of the Pacific has generously provided resources and support to complete the project. Prentice Hall offered a dedicated team of professionals who hand the book design and production. We are especially grateful to our acquisitions editor, Petra Recter and to the production editor, AudriAnna Bazlen. We also appreciate the efforts of Sara Burrows, assistant editor, who worked with us on the compilation of the supplements, and the work of Jennie Burger, who is doing the active marketing of the book.

Students have offered valuable criticism of the manuscript by giving us explicit feedback. Our reviewers offered guidance during the design of the new edition detailed comments on both the content and the pedagogical approach. We took most of their recommendations into account. Thanks go to Carol Roberts, University of Maine; Ken Bosworth, Idaho State University; Ralph Ewton, University of Texas, El Paso. Special thanks go to James Slack at Minnesota State University, Mankato, who made extensive and detailed suggestions. His insights and support were invaluable to the authors and greatly improved the final design and content of the book.

William Ford
William Topp


Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership