Skip to content

Commit

Permalink
New: Updated structure and implementation for 2018-2019 updates (#41)
Browse files Browse the repository at this point in the history
* Update: LinkedList to be ES6 and tested with Mocha/Chai

* Update: LinkedList implementation

* Update: Simplify LinkedList#values()

* Update: LinkedList README

* Chore: Fix JSDoc comment

* Chore: Update comments

* New: DoublyLinkedList implementation

* Chore: Add ESLint

* Remove: Old doubly linked list implementation

* Update: README information

* Chore: Add Travis CI
  • Loading branch information
nzakas authored Dec 8, 2018
1 parent f25c750 commit 3dd450c
Show file tree
Hide file tree
Showing 20 changed files with 3,271 additions and 1,306 deletions.
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
}
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
holding/
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: node_js
node_js:
- "8"
- "9"
- "10"
- "11"
sudo: false
branches:
only:
- master

# Run npm test always
script:
- "npm test"
82 changes: 60 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,84 @@
# Computer Science in JavaScript

by [Nicholas C. Zakas](https://humanwhocodes.com) (Find this useful? Consider [donating](https://humanwhocodes.com/donate) to support my work.)
by [Nicholas C. Zakas](https://humanwhocodes.com)

If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate).

## Description

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.

### Data Structures
## Folder Structure

Binary Search Tree
https://humanwhocodes.com/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/
https://humanwhocodes.com/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/
The most recent packages are found in these directories:

Doubly Linked List
https://humanwhocodes.com/blog/2009/04/21/computer-science-in-javascript-doubly-linked-lists/
* `src` - the implementation source code
* `tests`` - tests for the implementation source code

Linked List
https://humanwhocodes.com/blog/2009/04/13/computer-science-in-javascript-linked-list/
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:

### Sorting Algorithms
* `data-structures` - data structure implementations that have not been updated yet
* `encodings` - encoding implementations that have not been updated yet
* `algorithms` - miscellanous algorithm implementations that have not been updated yet

Bubble Sort
https://humanwhocodes.com/blog/2009/05/26/computer-science-in-javascript-bubble-sort/
As I update these, implementations will move from these folders into `src`.

Selection Sort
https://humanwhocodes.com/blog/2009/09/08/computer-science-in-javascript-selection-sort/
## Branches

### Other Algorithms
* **2009** - the branch containing all of the original implementations as reflected in my 2009 blog post series.
* **master** - the branch where I'm updating the original implementations to use ECMAScript 2018 and later features.

## Installing

You must be using Node.js v8 or later.

First, clone the repo:

```
$ git clone git://github.com/humanwhocodes/computer-science-in-javascript.git
$ cd computer-science-in-javascript
```

Then install the dependencies:

```
$ npm install
```

You can then run tests like this:

Base64 Encoding
https://humanwhocodes.com/blog/2009/12/08/computer-science-in-javascript-base64-encoding/
```
$ npm test
```

## Original Blog Posts

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.

### Data Structures

* 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/)
* [Doubly Linked List](https://humanwhocodes.com/blog/2009/04/21/computer-science-in-javascript-doubly-linked-lists/)
* [Linked List](https://humanwhocodes.com/blog/2009/04/13/computer-science-in-javascript-linked-list/)

### Sorting Algorithms

* [Bubble Sort](https://humanwhocodes.com/blog/2009/05/26/computer-science-in-javascript-bubble-sort/)
* [Selection Sort](https://humanwhocodes.com/blog/2009/09/08/computer-science-in-javascript-selection-sort/)

### Other Algorithms

Binary Search
https://humanwhocodes.com/blog/2009/09/01/computer-science-in-javascript-binary-search/
* [Base64 Encoding](https://humanwhocodes.com/blog/2009/12/08/computer-science-in-javascript-base64-encoding/)
* [Binary Search](https://humanwhocodes.com/blog/2009/09/01/computer-science-in-javascript-binary-search/)
* [Credit Card Number Validation](https://humanwhocodes.com/blog/2009/08/04/computer-science-in-javascript-credit-card-number-validation/)

Credit Card Number Validation
https://humanwhocodes.com/blog/2009/08/04/computer-science-in-javascript-credit-card-number-validation/
## Note on Code Style

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.

## Issues and Pull Requests

Because this repository is based on a series of blog posts I wrote, I only accept issues and pull requests related to bugs.
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.

## License

Expand Down
228 changes: 0 additions & 228 deletions data-structures/doubly-linked-list/doubly-linked-list-tests.htm

This file was deleted.

Loading

0 comments on commit 3dd450c

Please sign in to comment.