|
1 | 1 | # Computer Science in JavaScript
|
2 | 2 |
|
3 |
| -by [Nicholas C. Zakas](https://humanwhocodes.com) (Find this useful? Consider [donating](https://humanwhocodes.com/donate) to support my work.) |
| 3 | +by [Nicholas C. Zakas](https://humanwhocodes.com) |
| 4 | + |
| 5 | +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). |
4 | 6 |
|
5 | 7 | ## Description
|
6 | 8 |
|
7 | 9 | Collection of classic computer science paradigms, algorithms, and approaches written in JavaScript. This is the source code for the series of blog posts on my website.
|
8 | 10 |
|
9 |
| -### Data Structures |
| 11 | +## Folder Structure |
10 | 12 |
|
11 |
| -Binary Search Tree |
12 |
| -https://humanwhocodes.com/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/ |
13 |
| -https://humanwhocodes.com/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/ |
| 13 | +The most recent packages are found in these directories: |
14 | 14 |
|
15 |
| -Doubly Linked List |
16 |
| -https://humanwhocodes.com/blog/2009/04/21/computer-science-in-javascript-doubly-linked-lists/ |
| 15 | +* `src` - the implementation source code |
| 16 | +* `tests`` - tests for the implementation source code |
17 | 17 |
|
18 |
| -Linked List |
19 |
| -https://humanwhocodes.com/blog/2009/04/13/computer-science-in-javascript-linked-list/ |
| 18 | +These directories contain **old** implementations that will be replaced eventually, they are just here to avoid confusing people who find this repo through the old blog posts: |
20 | 19 |
|
21 |
| -### Sorting Algorithms |
| 20 | +* `data-structures` - data structure implementations that have not been updated yet |
| 21 | +* `encodings` - encoding implementations that have not been updated yet |
| 22 | +* `algorithms` - miscellanous algorithm implementations that have not been updated yet |
22 | 23 |
|
23 |
| -Bubble Sort |
24 |
| -https://humanwhocodes.com/blog/2009/05/26/computer-science-in-javascript-bubble-sort/ |
| 24 | +As I update these, implementations will move from these folders into `src`. |
25 | 25 |
|
26 |
| -Selection Sort |
27 |
| -https://humanwhocodes.com/blog/2009/09/08/computer-science-in-javascript-selection-sort/ |
| 26 | +## Branches |
28 | 27 |
|
29 |
| -### Other Algorithms |
| 28 | +* **2009** - the branch containing all of the original implementations as reflected in my 2009 blog post series. |
| 29 | +* **master** - the branch where I'm updating the original implementations to use ECMAScript 2018 and later features. |
| 30 | + |
| 31 | +## Installing |
| 32 | + |
| 33 | +You must be using Node.js v8 or later. |
| 34 | + |
| 35 | +First, clone the repo: |
| 36 | + |
| 37 | +``` |
| 38 | +$ git clone git://github.com/humanwhocodes/computer-science-in-javascript.git |
| 39 | +$ cd computer-science-in-javascript |
| 40 | +``` |
| 41 | + |
| 42 | +Then install the dependencies: |
| 43 | + |
| 44 | +``` |
| 45 | +$ npm install |
| 46 | +``` |
| 47 | + |
| 48 | +You can then run tests like this: |
30 | 49 |
|
31 |
| -Base64 Encoding |
32 |
| -https://humanwhocodes.com/blog/2009/12/08/computer-science-in-javascript-base64-encoding/ |
| 50 | +``` |
| 51 | +$ npm test |
| 52 | +``` |
| 53 | + |
| 54 | +## Original Blog Posts |
| 55 | + |
| 56 | +At some point I will update these blog posts for the new implementations. For now, they still refer only to the 2009 version of this code. |
| 57 | + |
| 58 | +### Data Structures |
| 59 | + |
| 60 | +* Binary Search Tree: [Part 1](https://humanwhocodes.com/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/), [Part 2](https://humanwhocodes.com/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/) |
| 61 | +* [Doubly Linked List](https://humanwhocodes.com/blog/2009/04/21/computer-science-in-javascript-doubly-linked-lists/) |
| 62 | +* [Linked List](https://humanwhocodes.com/blog/2009/04/13/computer-science-in-javascript-linked-list/) |
| 63 | + |
| 64 | +### Sorting Algorithms |
| 65 | + |
| 66 | +* [Bubble Sort](https://humanwhocodes.com/blog/2009/05/26/computer-science-in-javascript-bubble-sort/) |
| 67 | +* [Selection Sort](https://humanwhocodes.com/blog/2009/09/08/computer-science-in-javascript-selection-sort/) |
| 68 | + |
| 69 | +### Other Algorithms |
33 | 70 |
|
34 |
| -Binary Search |
35 |
| -https://humanwhocodes.com/blog/2009/09/01/computer-science-in-javascript-binary-search/ |
| 71 | +* [Base64 Encoding](https://humanwhocodes.com/blog/2009/12/08/computer-science-in-javascript-base64-encoding/) |
| 72 | +* [Binary Search](https://humanwhocodes.com/blog/2009/09/01/computer-science-in-javascript-binary-search/) |
| 73 | +* [Credit Card Number Validation](https://humanwhocodes.com/blog/2009/08/04/computer-science-in-javascript-credit-card-number-validation/) |
36 | 74 |
|
37 |
| -Credit Card Number Validation |
38 |
| -https://humanwhocodes.com/blog/2009/08/04/computer-science-in-javascript-credit-card-number-validation/ |
| 75 | +## Note on Code Style |
39 | 76 |
|
| 77 | +You may find the code style of this module to be overly verbose with a lot of comments. That is intentional, as the primary use of this module is intended to be for educational purposes. There are frequently more concise ways of implementing the details of this class, but the more concise ways are difficult for newcomers who are unfamiliar with linked lists as a concept or JavaScript as a whole. |
40 | 78 |
|
41 | 79 | ## Issues and Pull Requests
|
42 | 80 |
|
43 |
| -Because this repository is based on a series of blog posts I wrote, I only accept issues and pull requests related to bugs. |
| 81 | +As this is part of series of tutorials I'm writing, only bug fixes will be accepted. No new functionality will be added to this module. |
44 | 82 |
|
45 | 83 | ## License
|
46 | 84 |
|
|
0 commit comments