|
| 1 | +学习JavaScript数据结构与算法 |
| 2 | +==================================== |
| 3 | + |
| 4 | +[](https://travis-ci.org/loiane/javascript-datastructures-algorithms) |
| 5 | +[](https://codecov.io/gh/loiane/javascript-datastructures-algorithms) |
| 6 | +[](https://david-dm.org/loiane/javascript-datastructures-algorithms?type=dev) |
| 7 | +[](https://david-dm.org/loiane/javascript-datastructures-algorithms) |
| 8 | +[](https://greenkeeper.io/) |
| 9 | + |
| 10 | +《**学习JavaScript数据结构与算法**》第三版书籍源代码。 |
| 11 | + |
| 12 | +## 可用章节列表: |
| 13 | + |
| 14 | +* 01: [JavaScript 快速概览](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter01_02) |
| 15 | +* 02: [ECMAScript 和 TypeScript 介绍](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter01_02) |
| 16 | +* 03: [数组](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter03) |
| 17 | +* 04: [栈](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter04) |
| 18 | +* 05: [队列和双端队列](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter05) |
| 19 | +* 06: [链表](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter06) |
| 20 | +* 07: [集合](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter07) |
| 21 | +* 08: [字典和散列表](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter08) |
| 22 | +* 09: [递归](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter09) |
| 23 | +* 10: [树](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter10) |
| 24 | +* 11: [堆](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter11) |
| 25 | +* 12: [图](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter12) |
| 26 | +* 13: [排序和搜索算法](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter13) |
| 27 | +* 14: [算法设计与技巧](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter14) |
| 28 | +* 15: [算法复杂度](https://github.com/loiane/javascript-datastructures-algorithms/tree/third-edition/examples/chapter15) |
| 29 | + |
| 30 | +### 第三版更新内容 |
| 31 | + |
| 32 | +* 使用 ES2015+ (ES6+) 的算法实现 |
| 33 | +* 新的数据结构和算法 |
| 34 | +* 所有章节都经过重写和审查 |
| 35 | +* 新增三 (3) 个章节 |
| 36 | +* 创建了一个可在浏览器或 Node.js 中使用的数据结构和算法库 |
| 37 | +* 使用 Mocha + Chai 测试算法(测试代码在 `test` 目录中) |
| 38 | +* 包含源代码的 **TypeScript** 版本(包括库和测试) |
| 39 | + |
| 40 | +## 项目结构 |
| 41 | + |
| 42 | +`src/js/index.js` 文件包含按章节列出的所有数据结构和算法。 |
| 43 | + |
| 44 | +``` |
| 45 | +|_examples (如何使用每个数据结构和算法,按章节组织) |
| 46 | +|_src |
| 47 | +|___js (源代码:JavaScript 版本) |
| 48 | +|_____data-structures (数据结构) |
| 49 | +|_______models (数据结构使用的类:Node、ValuePair 等) |
| 50 | +|_____others (其他算法,如回文检查器、汉诺塔) |
| 51 | +|___ts (源代码:TypeScript 版本) |
| 52 | +|_____data-structures (数据结构) |
| 53 | +|_______models (模型) |
| 54 | +|_____others (其他算法) |
| 55 | +|_test (使用 Mocha 和 Chai 对 src 进行单元测试) |
| 56 | +|___js (JavaScript 代码测试) |
| 57 | +|___ts (TypeScript 代码测试) |
| 58 | +``` |
| 59 | + |
| 60 | +## 使用 Node.js 安装和运行书籍示例 |
| 61 | + |
| 62 | +* 安装 [Node](https://nodejs.org) |
| 63 | +* 打开终端/命令提示符,切换到项目文件夹目录:`cd /Users/.../javascript-datastructures-algorithms` (Linux/Mac) 或 `cd C:/.../javascript-datastructures-algorithms` (Windows) |
| 64 | +* 运行 `npm install` 安装所有依赖 |
| 65 | +* 要查看示例,运行 `http-server html` 或 `npm run serve`。在浏览器中打开 `http:\\localhost:8080` 查看书籍示例 |
| 66 | +* 或者 `cd html/chapter01` 并使用 node 运行每个 JavaScript 文件:`node 02-Variables` |
| 67 | + |
| 68 | +## 在浏览器中运行示例 |
| 69 | + |
| 70 | +* 右键点击您想要查看示例的 HTML 文件,右键选择 "使用 Chrome(或任何其他浏览器)打开" |
| 71 | + |
| 72 | +* 或者打开 `examples/index.html` 文件以轻松浏览所有示例: |
| 73 | + |
| 74 | +* 在线演示:[https://javascript-ds-algorithms-book.firebaseapp.com](https://javascript-ds-algorithms-book.firebaseapp.com) |
| 75 | + |
| 76 | +<img src="examples/examples-screenshot.png"> |
| 77 | + |
| 78 | +编程愉快! |
| 79 | + |
| 80 | +## 其他版本 |
| 81 | + |
| 82 | +| 第一版 | 第二版 | 第三版 | |
| 83 | +| ------------- |:-------------:|:-------------:| |
| 84 | +|  |  |  | |
| 85 | +| [书籍链接](http://amzn.to/1Y1OWPx)| [书籍链接](http://amzn.to/1TSkcA1)| [书籍链接](http://a.co/cbMlYmJ)| |
| 86 | + |
| 87 | +第一版书籍链接: |
| 88 | + - [Packt](https://www.packtpub.com/application-development/learning-javascript-data-structures-and-algorithms) |
| 89 | + - [Amazon](http://amzn.to/1Y1OWPx) |
| 90 | + - [中文版](http://www.ituring.com.cn/book/1613) |
| 91 | + - [韩文版](http://www.acornpub.co.kr/book/javascript-data-structure) |
| 92 | + |
| 93 | +第二版书籍链接: |
| 94 | + - [Packt](https://www.packtpub.com/web-development/learning-javascript-data-structures-and-algorithms-second-edition) |
| 95 | + - [Amazon](http://amzn.to/1TSkcA1) |
| 96 | + - [中文版](http://www.ituring.com.cn/book/2029) |
| 97 | + - [巴西葡萄牙语版](https://novatec.com.br/livros/estruturas-de-dados-algoritmos-em-javascript/) |
| 98 | + |
| 99 | +第三版书籍链接: |
| 100 | + - [Packt](https://www.packtpub.com/en-us/product/learning-javascript-data-structures-and-algorithms-9781788624947) |
| 101 | + - [Amazon](http://a.co/cbMlYmJ) |
| 102 | + - [中文版](http://www.ituring.com.cn/book/2653) |
| 103 | + - [巴西葡萄牙语版](https://novatec.com.br/livros/estruturas-de-dados-algoritmos-em-javascript-2ed/) |
| 104 | + |
| 105 | +### 发现问题或有疑问? |
| 106 | + |
| 107 | +请创建一个 [Issue](https://github.com/loiane/javascript-datastructures-algorithms/issues) 或 [Pull Request](https://github.com/loiane/javascript-datastructures-algorithms/pulls) |
0 commit comments