数据结构与算法分析-C++版答案 下载本文

内容发布更新时间 : 2024/6/26 12:01:20星期一 下面是文章的全部内容请认真阅读。

Data Structures and Algorithm 习题答案

Preface ii

1 Data Structures and Algorithms 1 2 Mathematical Preliminaries 5 3 Algorithm Analysis 17

4 Lists, Stacks, and Queues 23 5 Binary Trees 32 6 General Trees 40 7 Internal Sorting 46

8 File Processing and External Sorting 54 9Searching 58 10 Indexing 64 11 Graphs 69

12 Lists and Arrays Revisited 76 13 Advanced Tree Structures 82 i

ii Contents

14 Analysis Techniques 88 15 Limits to Computation 94

Preface

Contained herein are the solutions to all exercises from the textbook A Practical Introduction to Data Structures and Algorithm Analysis, 2nd edition.

For most of the problems requiring an algorithm I have given actual code. In a few cases I have presented pseudocode. Please be aware that the code presented in this manual has not actually been compiled and tested. While I believe the algorithms

to be essentially correct, there may be errors in syntax as well as semantics. Most importantly, these solutions provide a guide to the instructor as to the intended

answer, rather than usable programs.