数据结构与算法:C#语言描述 数据结构与算法:C#语言描述

3星(超过75%的资源)
所需积分/C币:50 2013-05-12 10:31:28 5.17MB PDF
51
收藏 收藏
举报

[英文版]本书是在.NET框架下用C#语言实现数据结构和算法的第一本全面的参考书。本书介绍的方法非常实用,采用了时间测试而非大O表示法来分析算法性能。内容涵盖了数据结构和算法的基本原理,涉及数组、广义表、链表、散列表、树、图、排序搜索算法以及更多概率算法和动态规则等高级算法。此外,书中还提供了.NET框架类库中的C#语言实现的数据结构和算法。   本书适合作为C#数据结构课程的教材,同时也适合C#专业人士阅读。 第1章 Collections类、泛型类和Timing类概述   1.1 群集的定义   1.2 群集的描述    1.2.1 直接存取群集    1.2.2 顺序存取群集    1.2.3 层次群集    1.2.4 组群集   1.3 CollectionBase类    1.3.1 用ArrayList实现Collection类    1.3.2 定义Collection类    1.3.3 实现Collection类   1.4 泛型编程   1.5 时间测试    1.5.1 一个简单化的时间测试    1.5.2 用于.NET环境的时间测试    1.5.3 Timing Test类   小结   练习  第2章 数组和ArrayList   2.1 数组基本概念    2.1.1 数组的声明和初始化    2.1.2 数组元素的设置和存取访问    2.1.3 检索数组元数据的方法和属性    2.1.4 多维数组    2.1.5 参数数组    2.1.6 锯齿状数组  2.2 ArrayList类    2.2.1 ArrayList类的成员    2.2.2 应用ArrayList类   小结   练习  第3章 基础排序算法   3.1 排序算法    3.1.1 数组类测试环境    3.1.2 冒泡排序    3.1.3 检验排序过程    3.1.4 选择排序    3.1.5 插入排序   3.2 基础排序算法的时间比较   小结   练习  第4章 基础查找算法   4.1 顺序查找    4.1.1 查找最小值和最大值    4.1.2 自组织数据加快顺序查找速度   4.2 二叉查找算法   4.3 递归二叉查找算法   小结   练习  第5章 栈和队列   5.1 栈、栈的实现以及Stack类    5.1.1 栈的操作    5.1.2 Stack类的实现   5.2 Stack类    5.2.1 Stack构造器方法    5.2.2 主要的栈操作    5.2.3 Peek方法    5.2.4 Clear方法    5.2.5 Contains方法    5.2.6 CopyTo方法和ToArray方法    5.2.7 Stack类的实例:十进制向多种进制的转换   5.3 队列、Queue类以及Queue类的实现    5.3.1 队列的操作    5.3.2 Queue的实现    5.3.3 Queue类:实例应用    5.3.4 用队列排序数据    5.3.5 源自Queue类的优先队列   小结   练习  第6章 BitArray类   6.1 激发的问题   6.2 位和位操作    6.2.1 二进制数制系统    6.2.2 处理二进制数:按位运算符和移位运算符   6.3 按位运算符的应用   6.4 整数转换成二进制形式的应用程序   6.5 移位的示例应用程序   6.6 BitArray类    6.6.1 使用BitArray类    6.6.2 更多BitArray类的方法和属性   6.7 用BitArray来编写埃拉托斯特尼筛法   6.8 BitArray与数组在埃拉托斯特尼筛法上的比较   小结   练习  第7章 字符串、String类和StringBuilder类 第8章 模式匹配和文本处理 第9章 构建字典:DictionaryBase类和SortedList类 第10章 散列和Hashtable类 第11章 链表  第12章 二叉树和二叉查找树 第13章 集合  第14章 高级排序算法  第15章 用于查找的高级数据结构和算法 第16章 图和图的算法 第17章 高级算法  参考文献  索引
PI. FO 0521670152pre CUNY656/McMillan Printer: cupusbw 0 521 67015 2 February 17, 2007 20: 59 PI. FO 0521670152pre CUNY656/McMillan Printer: cupusbw 0 521 67015 2 February 17, 2007 20: 59 DATA STRUCTURES AND ALGORITHMS US|NGc井 MICHAEL MCMILLAN Pulaski Technical College CAMBRIDGE UNIVERSITY PRESS CAMBRIDGE UNIVERSITY PRESS Cambridge, New York, Melbourne, Madrid, Cape Town, Singapore, Sao Paulo Cambridge University Press The Edinburgh Building, Cambridge CB2 8RU, UK Published in the United States of America by Cambridge University Press, New York www.cambridge.org nformationonthistitlewww.cambridge.org/9780521876919 C Michael mcmillan 2007 This publication is in copyright. Subject to statutory exception and to the provision of relevant collective licensing agreements, no reproduction of any part may take place without the llausv permission of Cambridge University Press First published in print format 2007 ISBN-13978-0-521-87691-9 hardback ISBN-10 0-521-87691-5 hardback ISBN-13 978-0-521-67015-9 paperback ISBN-10 0-521-67015-2 paperback Cambridge University Press has no responsibility for the persistence or accuracy of urls for external or third-party internet websites referred to in this publication, and does not guarantee that any content on such websites is, or will remain, accurate or appropriate PI. FO 0521670152pre CUNY656/McMillan Printer: cupusbw 0 521 670152 February 17, 2007 20: 59 Contents Preface page vil Chapter 1 An introduction to collections Generics, and the Timing Class Chapter 2 Arrays and Array Lists 26 Chapter 3 Basic Sorting Algorithms 42 Chapter 4 Basic Searching algorithms 55 Chapter 5 Stacks and Queues 68 Chapter 6 The BitArray class 94 Chapter 7 Strings, the String Class, and the StringBuilder class 119 Chapter 8 Pattern Matching and Text Processing 147 PI. FO 0521670152pre CUNY656/McMillan Printer: cupusbw 0 521 670152 February 17, 2007 20: 59 CoNTENTS Chapter 9 Building Dictionaries: The Dictionary Base Class and the Sortedlist class 165 Chapter 10 Hashing and the Hashtable class 176 Chapter 11 Linked Lists 194 Chapter 12 Binary Trees and Binary Search Trees 218 Chapter 13 Sets 237 Chapter 14 Advanced Sorting Algorithms 249 Chapter 15 Advanced Data Structures and Algorithms for Searching 263 Chapter 16 Graphs and graph algorithms 283 Chapter 17 Advanced Algorithms 314 References 339 Index 341 PI. FO 0521670152pre CUNY656/McMillan Printer: cupusbw 0 521 67015 2 February 17, 2007 20: 59 Preface The study of data structures and algorithms is critical to the development of the professional programmer. There are many, many books written on data structures and algorithms, but these books are usually written as college textbooks and are written using the programming languages typically taught in college--Java or C++. C# is becoming a very popular language and this book provides the C# programmer with the opportunity to study fundamental data structures and algorithms C# exists in a very rich development environment called the nEt frame work. Included in the. NET Framework library is a set of data structure classes (also called collection classes), which range [rom the Array, ArrayList, and Collection classes to the stack and Queue classes and to the Hash Table and the SortedList classes. The data structures and algorithms student can now see how to use a data structure before learning how to implement it. Previously an instructor had to discuss the concept of, say, a stack, abstractly until the complete data structure was constructed. Instructors can now show students how to use a stack to perform some computation, such as number base con versions, demonstrating the utility of the data structure immediately. with this background, the student can then go back and learn the fundamentals of the data structure (or algorithm) and even build their own implementation This book is written primarily as a practical overview of the data struc- tures and algorithms all serious computer programmers need to know and understand. Given this, there is no formal analysis of the data structures and algorithms covered in the book. Hence, there is not a single mathematical formula and not one mention of Big Oh analysis (if you don,'t know what this means, look at any of the books mentioned in the bibliography). Instead, the various data structures and algorithms are presented as problem-solving tools PI. FO 0521670152pre CUNY656/McMillan Printer: cupusbw 0 521 67015 2 February 17, 2007 20: 59 v PREFACE Simple timing tests are used to compare the performance of the data structures and algorithms discussed in the book PREREQUISITES The only prerequisite for this book is that the reader have some familiarity with the C# language in general, and object-oriented programming in C# in particular CHAPTER-BY-CHAPTER ORGANIZATION Chapter l introduces the reader to the concept of the data structure as a collection of data. The concepts of linear and nonlinear collections are intro duced. The Collection class is demonstrated This chapter also introduces the concept of generic programming, which allows the programmer to write one class, or one method, and have it work for a multitude of data types. Generic programming is an important new addition to C#(available in C# 2.0 and beyond), so much so that there is a special library of generic data structures found in the System. Collections. Generic namespace. When a data structure has a generic implementation found in this library, its use is discussed.The chapter ends with an introduction to methods of measuring the performance of the data structures and algorithms discussed in the book Chapter 2 provides a review of how arrays are constructed, along with demonstrating the features of the array class. The Array class encapsulates many of the functions associated with arrays(UBound, LBound, and so on into a single package. ArrayLists are special types of arrays that provide dynamic resizing capabilities Chapter 3 is an introduction to the basic sorting algorithms, such as the bubble sort and the insertion sort, and Chapter 4 examines the most funda- mental algorithms for searching memory the sequential and binary searches Two classic data structures are examined in Chapter 5: the stack and the queue. The emphasis in this chapter is on the practical use of these data structures in solving everyday problems in data processing. Chapter 6 covers the bitarray class, which can be used to efficiently represent a large number f integer values, such as test scores Strings are not usually covered in a data structures book, but Chapter 7 covers strings, the String class, and the String Builder class. Because so much PI. FO 0521670152pre CUNY656/McMillan Printer: cupusbw 0 521 67015 2 February 17, 2007 20: 59 PREFACE data processing in c# is performed on strings, the reader should be exposed to the special techniques found in the two classes. Chapter 8 examines the use of regular expressions for text processing and pattern matching. Regular expressions often provide more power and efficiency than can be had with more traditional string functions and methods Chapter g introduces the reader to the use of dictionaries as data structures Dictionaries, and the different data structures based on them. store data as key/value pairs. This chapter shows the reader how to create his or her own classes based on the dictionary Base class, which is an abstract class. Chap- ter 10 covers hash tables and the hash Table class, which is a special type of dictionary that uses a hashing algorithn for storing dala internally Another classic data structure, the linked list, is covered in Chapter 11 Linked lists are not as important a data structure in C# as they are in a pointer-based language such as C++, but they still have a role in C# program ming. Chapter 12 introduces the reader to yet another classic data structure- he binary tree. a specialized type of binary tree, the binary search tree, is the primary topic of the chapter. Other types of binary trees are covered in Chapter 15 Chapter 13 shows the reader how to store data in sets, which can be usefulin situations in which only unique data values can be stored in the data structure Chapter 14 covers more advanced sorting algorithms, including the popular and efficient QuickSort, which is the basis for most of the sorting procedures implemented in the. NET Framework library. Chapter 15 looks at three data structures that prove useful for searching when a binary search tree is not called for: the AVI tree, the red-black tree, and the skip list Chapter 16 discusses graphs and graph algorithms. Graphs are useful for representing many different types of data, especially networks. Finally, Chap ter 17 introduces the reader to what algorithm design techniques really are dynamic algorithms and greedy algorithms ACKNOWLEDGEMENTS There are several different groups of people who must be thanked for helping me finish this book. First, thanks to a certain group of students who first sat through my lectures on developing data structures and algorithms. These students include (not in any particular order ): Matt Hoffman, Ken Chen, Ken Cates, Jeff Richmond, and Gordon Caffey. Also, one of my fellow instructors at Pulaski Technical College, Clayton Ruff. sat through many of the lectures

...展开详情
试读 127P 数据结构与算法:C#语言描述 数据结构与算法:C#语言描述
立即下载
限时抽奖 低至0.43元/次
身份认证后 购VIP低至7折
一个资源只可评论一次,评论内容不能少于5个字
Michael_Wang111 讲解比较全面,内容探讨的很深入
2014-03-27
回复
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
关注 私信
上传资源赚钱or赚积分
最新推荐
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述 50积分/C币 立即下载
1/127
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第1页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第2页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第3页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第4页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第5页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第6页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第7页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第8页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第9页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第10页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第11页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第12页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第13页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第14页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第15页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第16页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第17页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第18页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第19页
数据结构与算法:C#语言描述 数据结构与算法:C#语言描述第20页

试读结束, 可继续阅读

50积分/C币 立即下载