趣味C程序设计集锦.pdf
《趣味C程序设计集锦(爱上程序设计)》作为计算机C程序设计的科普读物与学习C语言程序设计的教学参考书,着眼于应用C程序设计求解问题的基本方法与技巧,提高通过C程序设计解决实际问题的能力。《趣味C程序设计集锦(爱上程序设计)》以各类趣题的C程序设计求解为主线,取材注重典型性与趣味性,程序注重结构化与可读性。所精选的趣解包括典型的数值求解、常见的数据处理、有趣的智力游戏、巧妙的模拟探索、新颖的图表创建,大多是引导入门的基础题、常规题,也适当设计少量难度较大的综合题与经典名题,难度适宜,深入浅出。
Neural Networks and Deep Learning神经网络与深度学习 翻译版.pdf
深度学习很好的学习资料,从BP神经网络写到深度学习,以手写体数字识别贯穿全文,写的深入浅出,十分通俗易懂。
《Neural Networks and Deep Learning》,by Yoshua Bengio, Ian Goodfellow, and Aaron Courville
这本书中的代码基于Python实现,从MNIST这个例子出发,讲人工神经网络(Neural networks),逐步深入到深度学习(Deep Learning),以及代码实现,一些优化方法。适合作为入门书。
深入浅出 [Head.First.JavaScript.2008].Michael.Morrison.文字版.pdf
Want to make the leap from writing HTML and CSS web pages and create dynamic web applications? Want to take your web skills to the next level? It sounds like you're ready to learn the Web's hottest programming language: JavaScript. Head First JavaScript is your ticket to going beyond copying and pasting the code from someone else's web site, and writing your own interactive web pages.
So you're ready to make the leap from writing HTML and CSS web pages to creating dynamic web applications. You want to take your web skills to the next level. And you're finally ready to add "programmer" to the resume. It sounds like you're ready to learn the Web's hottest programming language: JavaScript. Head First JavaScript is your ticket to going beyond copying and pasting the code from someone else's web site, and writing your own interactive web pages.
With Head First JavaScript, you learn:
The basics of programming, from variables to types to looping
How the web browser runs your code, and how you can talk to the browser with your code
Why you'll never have to worry about casting, overloading, or polymorphism when you're writing JavaScript code
How to use the Document Object Model to change your web pages without making your users click buttons
If you've ever read a Head First book, you know what to expect -- a visually rich format designed for the way your brain works. Head First JavaScript is no exception. It starts where HTML and CSS leave off, and takes you through your first program into more complex programming concepts -- like working directly with the web browser's object model and writing code that works on all modern browsers.
Don't be intimidated if you've never written a line of code before! In typical Head First style, Head First JavaScript doesn't skip steps, and we're not interested in having you cut and paste code. You'll learn JavaScript, understand it, and have a blast along the way. So get ready... dynamic and exciting web pages are just pages away.
Perl编程语言.pdf
这不仅仅是一本关于Perl的书籍,更是一本独一无二的开发者自己介绍该语言及其文化的书籍。Larry Wall是Perl的开发者,他就这种语言的未来发展方向提出了自己的看法。Tom Christiansen是最早的几个拥护者之一,也是少数几个在错综复杂的中游刃有余的人之一。Jon Orwant是《Perl Journal》的主编,该杂志把Perl社区组合成了一个共同的论坛,以进行Perl新的开发。
前言
第一部分 概述
第一章 Perl概述
第二部分 细节
第二章 集腋成裘
第三章 一元和二元操作符
第四章 语句和声明
第五章 模式匹配
第六章 子例程
第七章 格式
第八章 引用
第九章 数据结构
第十章 包
第十一章 模块
第十二章 对象
第十三章 重载
第十四章 绑定变量
第三部分 作为技术的Perl
第十五章 Uicde
第十六章 进程间通信
第十七章 线程
第十八章 编译
第十九章 命令行接口
第二十章 Perl调试器
第二十一章 内部和外部
第四部分 作为文化的Perl
第二十二章 CPA
第二十三章 安全
第二十四章 通用实践
第二十五章 可移植的Perl
第二十六章 pd
第二十七章 Perl文化
第五部分 参考资料
第二十八章 特殊名字
第二十九章 函数
第三十章 标准Perl库
第三十一章 pragma
第三十二章 标准模块
第三十三章 诊断消息
词汇表
数据结构与算法分析(C++描述)(第3版)-[美]Mark Allen Weiss, 中译版, 2006.pdf
Mark Allen Weiss教授撰写的数据结构与算法分析方面的著作曾被评为20世纪最佳的30部计算机著作之一,已经成为公认的经典之作,被全球数百所大学采用为教材,广受好评。
《数据结构与算法分析:C++描述》一书秉承Weiss著全一贯的严谨风格,同时又突出了实践。书中充分应用了现代C++语言特性,透彻地讲述了数据结构的原理和应用,不仅使学生具备算法分析能力,能够开发高效的程序,而且让学生掌握良好的程序设计技巧。
Chapter 1 Introduction 1
1.1 What's the Book About? 1
1.2 Mathematics Review 2
1.2.1 Exponents 3
1.2.2 kogarithms 3
1.2.3 Series 4
1.2.4 Modular Arithmetic 5
1.2.5 The P Word 6
1.3 A Brief Introduction to Recursion 7
1.4 C++ Classes 11
1.4.i Basic class Syntax 12
1.4.2 Extra Constructor Syntax and Accessors 12
1.4.3 Separation of Interface and Implementation 15
1.4.4 vector and string 17
1.5 C++ Details 19
1.5.1 Pointers 19
1.5.2 Parameter Passing 21
1.5.3 Return Passing 22
1.5.4 Reference Variables 23
1.5.5 The Big Three: Destructor, Copy Constructor, operator= 23
1.5.6 C-style Arrays and Strings 26
1.6 Templates 29
1.6.1 Function Templates 29
1.6.2 Class Templates 30
1.6.3 Object, Comparable, and an Example 32
1.6.4 Function Objects 34
1.6.5 Separate Compilation of Class Templates 35
1.7 Using Matrices 37
1.7.1 The Data Members, Constructor, and Basic Accessors 37
1.7.2 operator[] 37
1.7.3 Destructor, Copy Assignment, Copy Constructor 39
Summary 39
Exercises 39
References 41
Chapter 2 Algorithm Analysis 43
2.1 Mathematical Background 43
2.2 Model 46
2.3 What to Analyze 46
2.4 Running Time Calculations 49
2.4.1 A Simple Example 49
2.4.2 General Rules 50
2.4.3 Solutions for the Maximum Subsequence Sum Problem 52
2.4.4 Logarithms in the Running Time 58
2.4.5 Checking Your Analysis 62
2.4.6 A Grain of Salt 63
Summary 63
Exercises 64
References 69
Chapter 3 Lists, Stacks, and Queues 71
3.1 Abstract Data Types (ADTs) 71
3.2 The List ADT 72
3.2.1 Simple Array Implementation of Lists 72
3.2.2 Simple Linked Lists 73
3.3 vector and list in the STL 74
3.3.1 Iterators 75
3.3.2 Example: Using erase on a List 77
3.3.3 const iterators 77
3.4 Implementation of vector 79
3.5 Implementation of list 83
3.6 The Stack ADT 94
3.6.1 Stack Model 94
3.6.2 Implementation of Stacks 95
3.6.3 Applications 96
3.7 The Queue ADT 104
3.7.1 Queue Model 104
3.7.2 Array Implementation of Queues 104
3.7.3 Applications of Queues 106
Summary 107
Exercises 108
Chapter 4 Trees 113
4.1 Preliminaries 113
4.1.1 Implementation of Trees 114
4.1.2 Tree Traversals with an Application 115
4.2 Binary Trees 119
4.2.1 Implementation 120
4.2.2 An Example: Expression Trees 121
4.3 The Search Tree ADT Binary Search Trees 124
4.3.1 contains 125
4.3.2 findMin and findMax 125
4.3.3 insert 129
4.3.4 remove 130
4.3.5 Destructor and Copy Assignment Operator 132
4.3.6 Average-Case Analysis 133
4.4 AVL Trees 136
4.4.1 Single Rotation 139
4.4.2 Double Rotation 142
4.5 Splay Trees 149
4.5.1 A Simple Idea (That Does Not Work) 150
4.5.2 Splaying 152
4.6 Tree Traversals (Revisited) 158
4.7 B-Trees 159
4.8 Sets and Maps in the Standard Library 165
4.8.1 Sets 165
4.8.2 Maps 166
4.8.3 Implementation of set and map 167
4.8.4 An Example That Uses Several Maps 168
Summary 174
Exercises 174
References 181
Chapter 5 Hashing 185
5.1 General Idea 185
5.2 Hash Function 186
5.3 Separate Chaining 188
5.4 Hash Tables Without Linked Lists 192
5.4.1 Linear Probing 193
5.4.2 Quadratic Probing 195
5.4.3 Double Hashing 199
5.5 Rehashing 200
5.6 Hash Tables in the Standard Library 204
5.7 Extendible Hashing 204
Summary 207
Exercises 208
References 211
Chapter 6 Priority Queues (Heaps) 213
6.1 Model 213
6.2 Simple Implementations 214
6.3 Binary Heap 215
6.3.1 Structure Property 215
6.3.2 Heap-Order Property 216
6.3.3 Basic Heap Operations 217
6.3.4 Other Heap Operations 220
6.4 Applications of Priority Queues 225
6.4.1 The Selection Problem 226
6.4.2 Event Simulation 227
6.5 d-Heaps 228
6.6 Leftist Heaps 229
6.6.1 Leftist Heap Property 229
6.6.2 Leftist Heap Operations 230
6.7 Skew Heaps 235
6.8 Binomial Queues 239
6.8.1 Binomial Queue Structure 240
6.8.2 Binomial Queue Operations 241
6.8.3 Implementation of Binomial Queues 244
6.9 Priority Queues in the Standard Library 251
Summary 251
Exercises 251
References 257
Chapter 7 Sorting 261
7.1 Preliminaries 261
7.2 Insertion Sort 262
7.2.1 The Algorithm 262
7.2.2 STL Implementation of Insertion Sort 263
7.2.3 Analysis of Insertion Sort 264
7.3 A Lower Bound for Simple Sorting Algorithms 265
7.4 Shellsort 266
7.4.1 Worst-Case Analysis of Shellsort 268
7.5 Heapsort 270
7.5.1 Analysis of Heapsort 272
7.6 Mergesort 274
7.6.1 Analysis of Mergesort 276
7.7 Quicksort 279
7.7.1 Picking the Pivot 280
7.7.2 Partitioning Strategy 282
7.7.3 Small Arrays 284
7.7.4 Actual Quicksort Routines 284
7.7.5 Analysis of Quicksort 287
7.7.6 A Linear-Expected-Time Algorithm for Selection 290
7.8 Indirect Sorting 292
7.8.1 vector Does Not Work 295
7 8.2 Smart Pointer Class 295
7 8.3 Overloading operator< 295
7 8.4 Dereferencing a Pointer with * 295
7 8.5 Overloading the Type Conversion Operator 295
7 8.6 Implicit Type Conversions Are Everywhere 296
7 8.7 Dual-Direction Implicit Conversions Can Cause Ambiguities 296
7 8.8 Pointer Subtraction Is Legal 297
7.9 A General Lower Bound for Sorting 297
7.9.1 Decision Trees 297
7.10 Bucket Sort 299
7.11 External Sorting 300
7 11.1 Why We Need New Algorithms 300
7 11.2 Model for External Sorting 300
7 11.3 The Simple Algorithm 301
7 11.4 Multiway Merge 302
7 11.5 Polyphase Merge 303
7 11.6 Replacement Selection 304
Summary 305
Exercises 306
References 311
Chapter 8 The Disjoint Set Class 315
8.1 Equivalence Relations 315
8.2 The Dynamic Equivalence Problem 316
8.3 Basic Data Structure 317
8.4 Smart Union Algorithms 321
8.5 Path Compression 324
8.6 Worst Case for Union-by-Rank and Path Compression 325
8.6.1 Analysis of the Union~ind Algorithm 326
8.7 An Application 331
Summary 334
Exercises 335
References 336
Chapter 9 Graph Algorithms 339
9.1 Definitions 339
9.1.1 Representation of Graphs 340
9.2 Topological Sort 342
9.3 Shortest-Path Algorithms 345
9.3.1 Unweighted Shortest Paths 347
9.3.2 Dijkstra's Algorithm 351
9.3.3 Graphs with Negative Edge Costs 360
9.3.4 Acyclic Graphs 360
9.3.5 All-Pairs Shortest Path 364
9.3.6 Shortest Path Example 365
9.4 Network Flow Problems 367
9.4.1 A Simple Maximum-Flow Algorithm 367
9.5 Minimum Spanning Tree 372
9.5.1 Prim's Algorithm 373
9.5.2 Kruskal's Algorithm 376
9.6 Applications of Depth-First Search 378
9.6.1 Undirected Graphs 379
9.6.2 Biconnectivity 381
9.6.3 Euler Circuits 385
9.6.4 Directed Graphs 388
9.6.5 Finding Strong Components 390
9.7 Introduction to NP-Completeness 392
9.7.1 Easy vs. Hard 392
9.7.2 The Class NP 393
9.7.3 NP-Complete Problems 394
Summary 396
Exercises 396
References 404
Chapter 10 Algorithm Design Techniques 409
10.1 Greedy Algorithms 409
10.1.1 A Simple Scheduling Problem 410
10.1.2 Huffman Codes 413
10.1.3 Approximate Bin Packing 419
10.2 Divide and Conquer 427
10.2.1 Running Time of Divide and Conquer Algorithms 428
10.2.2 Closest-Points Problem 430
10.2.3 The Selection Problem 435
10.2.4 Theoretical Improvements for Arithmetic Problems 438
10.3 Dynamic Programming 442
10.3.1 Using a Table Instead of Recursion 442
10.3.2 Ordering Matrix Multiplications 444
10.3.3 Optimal Binary Search Tree 447
10.3.4 All-Pairs Shortest Path 451
10.4 Randomized Algorithms 454
10.4.1 Random Number Generators 455
10.4.2 Skip Lists 459
10.4.3 Primality Testing 461
10.5 Backtracking Algorithms 464
10.5.1 The Turnpike Reconstruction Problem 465
10.5.2 Games 469
Summary 475
Exercises 475
References 485
Chapter 11 Amortized Analysis 491
11.1 An Unrelated Puzzle 492
11.2 Binomial Queues 492
11.3 Skew Heaps 497
11.4 Fibonacci Heaps 499
11.4.1 Cutting Nodes in Leftist Heaps 500
11.4.2 Lazy Merging for Binomial Queues 502
11.4.3 The Fibonacci Heap Operations 506
11.4.4 Proof of the Time Bound 506
11.5 Splay Trees 509
Summary 513
Exercises 513
References 515
Chapter 12 Advanced Data Structures and Implementation 517
12.1 Top-Down Splay Trees 517
12.2 Red-Black Trees 525
12.2.1 Bottom-Up Insertion 526
12.2.2 Top-Down Red-Black Trees 527
12.2.3 Top-Down Deletion 531
12.3 Deterministic Skip Lists 535
12.4 AA-Trees 540
12.5 Treaps 547
12.6 k-d Trees 549
12.7 Pairing Heaps 553
Summary 558
Exercises 558
References 563
Appendix A Separate Compilation of Class Templates 567
A.1 Everything in the Header 568
A.2 Explicit Instantiation 568
A.3 The export Directive 570
Index 571
Programming Python, 4th Edition
《Python编程(影印版)(第4版)(套装共2册)》内容包括:Python快速入门:搭建一个简单的例子,包括数据表示、面向对象编程、对象持久化、GUI和网站基础;系统编程:针对命令行脚本编写、处理文件和文件夹、并行运行程序等需求探索系统接口工具和技术;GUI编程:学习使用Python tkinter组件库来创建完整的用户界面;互联网编程:访问客户端网络协议和电子邮件工具,使用CGI脚本,以及学习网站搭建技术;更多应用Python的地方:实现数据结构,分析基于文本的信息,访问数据库,以及扩展和嵌入Python。
本书和Learning_Python是配套书籍,作者是Mark Lutz
Python核心编程第二版(英文)
Python 核心编程是经典的Python指导书,在第一版的基础上进行了全面升级。全书分为两个部分:第1部分占据了大约三分之二的篇幅,阐释这门语言的“核心”内容,包括基本的概念和语句、语法和风格、 Python对象、数字类型、序列类型、映射和集合类型、条件和循环、文件和输入/输出、错误和异常、函数和函数式编程、模块、面向对象编程、执行环境等内容:第2部分则提供了各种高级主题来展示可以使用Python做些什么,包括正则表达式、网络编程、网络客户端编程、多线程编程、图形用户界面编程、 Web编程、数据库编程、扩展Python 和一些其他材料。
全书分为两个部分:第1部分占据了大约三分之二的篇幅,阐释这门语言的“核心”内容,包括基本的概念和语句、语法和风格、Python对象、数字类型、序列类型、映射和集合类型、条件和循环、文件和输入/输出、错误和异常、函数和函数式编程、模块、面向对象编程、执行环境等内容:第2部分则提供了各种高级主题来展示可以使用Python做些什么,包括正则表达式、网络编程、网络客户端编程、多线程编程、图形用户界面编程、Web编程、数据库编程、扩展Python 和一些其他材料。 本书适合Python初学者,以及已经入门但想继续学习和提高自身Python技巧的程序员。
人工智能及其应用 第4版(蔡自兴)
普通高等学校“十一五”国家级规划教材 国家级精品课程“人工智能”配套教材