Algorithms, Data Structures, and Problem Solving With C++

I. OBJECTS AND C++. 1. Pointers, Arrays, and Structures. What Are Pointers, Arrays, and Structures? Pointer Syntax in C++. Arrays. Dynamic Allocation of Arrays: new and delete. Memory Exhaustion. Pointer Arithmetic and Pointer Hopping. Reference Variables. Structures. 2. Objects and Classes. What Is Object-Oriented Programming? A Simple Example. A More Substantial Class: the Bit Array. Exploring More Details of the Class Interface. Additional C++ Class Features. Implementing a Class String. Recap: What Gets Called and What Are the Defaults? Separate Compilation. 3. Templates. What Is a Template? Template Functions. Template Classes. Fancy Templates. Bugs Associated with Templates. 4. Inheritance. What Are Polymorphism and Inheritance? A Derived Class: BoundedVector. Public, Private, and Protected Members and Inheritance. Static and Dynamic Binding. Constructors and Destructors: Virtual or not Virtual? Abstract Classes: A Shape Class. Multiple Inheritance. II. ALGORITHMS AND BUILDING BLOCKS. 5. Algorithm Analysis. What Is Algorithm Analysis? Examples of Algorithm Running Times. The Maximum Contiguous Subsequence Sum Problem. General Big-Oh Analysis. The Logarithm. Static Searching Problem. Checking an Algorithm Analysis. Limitations of Big-Oh Analysis. 6. Data Structures. Why Do We Need Data Structures? Stacks. Queues. Linked Lists. General Trees. Binary Search Trees. Hash Tables. Priority Queues. 7. Recursion. What Is Recursion? Background: Proofs by Mathematical Induction. Basic Recursion. Numerical Applications. Divide and Conquer. Dynamic Programming. Backtracking. 8. Sorting Algorithms. Why Is Sorting Important? Preliminaries. Analysis of Insertion Sort and Other Simple Sorts. Shellsort. Mergesort. Quicksort. Quickselect. A Lower Bound for Sorting. Indirect Sorting. 9. Randomization. Why Do We Need Random Numbers? Random Number Generators. Nonuniform Random Numbers9.4 : Generating a Random Permutation. Randomized Algorithms. Randomized Primality Testing. III. APPLICATIONS. 10. Fun and Games. Word Search Puzzles. The Game of Tic-Tac-Toe. 11. Stacks and Compilers. Balanced Symbol Checker. A Simple Calculator. 12. Utilities. File Compression. A Cross-Reference Generator. 13. Simulation. The Josephus Problem. Event-Driven Simulation. Graphs and Paths. Definitions. Unweighted Shortest Path Problem. Positive Weighted Shortest Path Problem. General Weighted Shortest Path Problem. Path Problems in Acyclic Graphs. IV. IMPLEMENTATIONS. 15. Stacks and Queues. Dynamic Array Implementations. Linked List Implementations. Comparison of the Two Methods. Double-Ended Queues. 16. Linked Lists. Basic Ideas. C++ Implementation. Doubly Linked Lists and Circular Linked Lists. Sorted Linked Lists. 17. Trees. General Trees. Binary Trees. Recursion and Trees. Tree Traversal: Iterator Classes. 18. Binary Search Trees. Basic Ideas. Order Statistics. Analysis of Binary Search Tree Operations. AVL Trees. Red Black Trees. AA Trees. B-Trees. 19. Hash Tables. Basic Ideas. Hash Function. Linear Probing. Quadratic Probing. Separate Chaining. 20. A Priority Queue: The Binary Heap. Basic Ideas. Implementation of the Basic Operations. FixHeap: Linear Time Heap Construction. Advanced Operations: DecreaseKey and Merge. Internal Sorting: Heapsort. External Sorting. V. ADVANCED DATA STRUCTURES. 21. Splay Trees. Self-adjustment and Amortized Analysis. The Basic Bottom-Up Splay Trees. Basic Splay Tree Operations. Analysis of Bottom-Up Splaying. Top-Down Splay Trees. Implementation of Top-Down Splay Trees. Comparison of the Splay Tree with Other Search Trees. 22. Merging Priority Queues. The Skew Heap. The Pairing Heap. 23. The Disjoint Set Class. Equivalence Relations. Dynamic Equivalence. The Quick-Find Algorithm. The Quick-Union Algorithm. C++ Implementation. Worst Case for Union-by-Rank and Path Compression. APPENDICES. Appendix A: Basic C++. Appendix B: Operators. Appendix C: Some Library Routines. Appendix D: Modifications for Exceptions. Index. 0805316663T04062001