Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jscriptcoder/javascript-algorithms
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: trekhleb/javascript-algorithms
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Jun 4, 2018

  1. Segment Tree implementation (trekhleb#45)

    * added segment tree implementation - supports custom operation
    
    * added readme for segment tree
    vignesh-m authored and trekhleb committed Jun 4, 2018
    Copy the full SHA
    2e5fd8d View commit details
  2. Update README.

    trekhleb committed Jun 4, 2018
    Copy the full SHA
    c7610d5 View commit details
  3. Add isPowerOfTwo functions.

    trekhleb committed Jun 4, 2018
    Copy the full SHA
    74b93d3 View commit details

Commits on Jun 5, 2018

  1. Copy the full SHA
    5784a4a View commit details
  2. Copy the full SHA
    434a564 View commit details
  3. Copy the full SHA
    9f83862 View commit details
  4. Fix the remove method for the MinHeap (trekhleb#50)

    * Fix LinkedList
    
    * Fix the prepend method for the LinkedList
    
    * Fix the remove method for the MinHeap
    m-maksyutin authored and trekhleb committed Jun 5, 2018
    Copy the full SHA
    38688f2 View commit details
  5. Copy the full SHA
    6c892c4 View commit details
  6. Copy the full SHA
    a1060c2 View commit details

Commits on Jun 6, 2018

  1. Added Binary Indexed Tree / Fenwick Tree Implementation (trekhleb#51)

    * added fenwick tree implementation
    
    * added fenwick tree implementation
    malfple authored and trekhleb committed Jun 6, 2018
    Copy the full SHA
    1a4fe11 View commit details
  2. Copy the full SHA
    183dade View commit details
  3. Update tests.

    trekhleb committed Jun 6, 2018
    Copy the full SHA
    00fbba5 View commit details
  4. Update READMEs.

    trekhleb committed Jun 6, 2018
    Copy the full SHA
    294bd2a View commit details

Commits on Jun 7, 2018

  1. Fix the translation of sorting complexity table (trekhleb#55)

    Array "Sorting" Algorithms Complexity should be 陣列排序演算法, not 陣列搜尋演算法
    d4n1elchen authored and trekhleb committed Jun 7, 2018
    Copy the full SHA
    39934eb View commit details

Commits on Jun 8, 2018

  1. Update READMEs.

    trekhleb committed Jun 8, 2018
    Copy the full SHA
    5ac85a2 View commit details
  2. Copy the full SHA
    d5a8b1e View commit details
  3. Add more tests.

    trekhleb committed Jun 8, 2018
    Copy the full SHA
    9de6bc7 View commit details

Commits on Jun 12, 2018

  1. Copy the full SHA
    bc17e4e View commit details
  2. Copy the full SHA
    7dc9b80 View commit details
  3. Refactor README.

    trekhleb committed Jun 12, 2018
    Copy the full SHA
    1e2fdc6 View commit details
  4. Refactor liuHui.

    trekhleb committed Jun 12, 2018
    Copy the full SHA
    c536aa2 View commit details
  5. Add Liu Hui to README.

    trekhleb committed Jun 12, 2018
    Copy the full SHA
    feed6d6 View commit details
  6. Update README.

    trekhleb committed Jun 12, 2018
    Copy the full SHA
    19aa6fa View commit details
  7. Fix typos (trekhleb#59)

    * Fixed typo in the word 'independant'
    
    * Fixed typo in the word 'subsequnce'
    
    * Fixed typo in the word 'icecream'
    
    * Fixed typo in the word 'subsequnce' in shortestCommonSubsequence
    
    * Fixed typo in the word 'depected'
    
    * Fixed typo in the word 'paramaters'
    Felix Rilling authored and trekhleb committed Jun 12, 2018
    Copy the full SHA
    5734e0a View commit details
  8. Update README.

    trekhleb committed Jun 12, 2018
    Copy the full SHA
    0c8155f View commit details
  9. Update README.

    trekhleb committed Jun 12, 2018
    Copy the full SHA
    c9cb6dc View commit details
  10. Update README.

    trekhleb committed Jun 12, 2018
    Copy the full SHA
    ebfd527 View commit details

Commits on Jun 13, 2018

  1. Copy the full SHA
    d57b725 View commit details
  2. Fix BST removal method.

    trekhleb committed Jun 13, 2018
    Copy the full SHA
    c3a9618 View commit details
  3. Copy the full SHA
    8d3f83c View commit details
  4. add recursive solution to permutations with repetitions problem (trek…

    …hleb#52)
    
    * add recursive solution to permutations with repetitions problem
    
    * fix untested function, failing test
    
    * add comments
    mmapplebeck authored and trekhleb committed Jun 13, 2018
    Copy the full SHA
    b0c55ec View commit details
  5. Copy the full SHA
    19f4cc7 View commit details

Commits on Jun 14, 2018

  1. Code style fixes.

    trekhleb committed Jun 14, 2018
    Copy the full SHA
    d154015 View commit details

Commits on Jun 18, 2018

  1. Copy the full SHA
    6d413d8 View commit details
  2. Copy the full SHA
    8c206a9 View commit details
  3. Code style fixes.

    trekhleb committed Jun 18, 2018
    Copy the full SHA
    98092ee View commit details
  4. Correct a comment (trekhleb#66)

    * Fix LinkedList
    
    * Fix the prepend method for the LinkedList
    
    * Fix the remove method for the MinHeap
    
    * Correct a comment
    m-maksyutin authored and trekhleb committed Jun 18, 2018
    Copy the full SHA
    9311735 View commit details
  5. Copy the full SHA
    87e59bf View commit details

Commits on Jun 19, 2018

  1. Update README.

    trekhleb committed Jun 19, 2018
    Copy the full SHA
    d74234d View commit details

Commits on Jun 21, 2018

  1. Z algorithm implementation (trekhleb#77)

    * Implemented Z algorithm
    
    * Fixed bugs in implementation and added tests
    
    * Added README explaining z algorithm
    hariv authored and trekhleb committed Jun 21, 2018
    Copy the full SHA
    9e210ae View commit details
  2. Code style fixes.

    trekhleb committed Jun 21, 2018
    Copy the full SHA
    5bdcbb3 View commit details
  3. Add comments.

    trekhleb committed Jun 21, 2018
    Copy the full SHA
    81d17bc View commit details
  4. Add comments.

    trekhleb committed Jun 21, 2018
    Copy the full SHA
    e558231 View commit details

Commits on Jun 22, 2018

  1. Fix BST removal method (trekhleb#74)

    * Fix LinkedList
    
    * Fix the prepend method for the LinkedList
    
    * Fix the remove method for the MinHeap
    
    * Correct a comment
    
    * Fix BST removal method
    m-maksyutin authored and trekhleb committed Jun 22, 2018
    Copy the full SHA
    bd5a16b View commit details
  2. Copy the full SHA
    2334583 View commit details
  3. Copy the full SHA
    16b6ea5 View commit details
  4. Copy the full SHA
    831ce89 View commit details
  5. Added Complexity of Each Algorithm in Sorting/ directory. (trekhleb#76)

    * Added Complexity to Bubble Sort README.md
    
    * Added Complexity to Counting-Sort README.md
    
    * Italicized n in Bubble Sort README.md
    
    * Added Complexity to Heap Sort README.md
    
    * Added Complexity to Insertion Sort README.md
    
    * Added Complexity to Merge Sort README.md
    
    * Added Complexity to Quick Sort README.md
    
    * Added Complexity to Radix Sort README.md
    
    * Added Complexity to Selection Sort README.md
    
    * Added Complexity to SHell Sort README.md
    mj-z-ali authored and trekhleb committed Jun 22, 2018
    Copy the full SHA
    e53f5f9 View commit details
  6. Update READMEs.

    trekhleb committed Jun 22, 2018
    Copy the full SHA
    b65a992 View commit details
  7. Update READMEs.

    trekhleb committed Jun 22, 2018
    Copy the full SHA
    413c134 View commit details
Showing 569 changed files with 43,889 additions and 8,439 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["env"]
"presets": ["@babel/preset-env"]
}
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# @see: https://editorconfig.org/
root = true

[*]
@@ -6,3 +7,5 @@ insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
quote_type = single
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -11,5 +11,11 @@
"class-methods-use-this": "off",
"arrow-body-style": "off",
"no-loop-func": "off"
},
"ignorePatterns": ["*.md", "*.png", "*.jpeg", "*.jpg"],
"settings": {
"react": {
"version": "18.2.0"
}
}
}
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @see: https://docs.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository
github: trekhleb
patreon: trekhleb
35 changes: 35 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16.x ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm i

- name: Run linting
run: npm run lint

- name: Run tests
run: npm run coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
.idea
coverage
.vscode
.DS_Store
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
# npm run test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.15.0
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

48 changes: 48 additions & 0 deletions BACKERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Project Backers

> You may support this project via ❤️️ [GitHub](https://github.com/sponsors/trekhleb) or ❤️️ [Patreon](https://www.patreon.com/trekhleb).
## `O(2ⁿ)` Backers

`null`

## `O(n²)` Backers

`null`

## `O(n×log(n))` Backers

`null`

<!--
<table>
<tr>
<td align="center">
<a href="[PROFILE_URL]">
<img
src="[PROFILE_IMG_SRC]"
width="50"
height="50"
/>
</a>
<br />
<a href="[PROFILE_URL]">[PROFILE_NAME]</a>
</td>
</tr>
</table>
-->

<!--
<ul>
<li>
<a href="[PROFILE_URL]">
<img
src="[PROFILE_IMG_SRC]"
width="30"
height="30"
/></a>
&thinsp;
<a href="[PROFILE_URL]">[PROFILE_NAME]</a>
</li>
</ul>
-->
21 changes: 20 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
## Contributing

**General Rules**

- As much as possible, try to follow the existing format of markdown and code.
- Don't forget to run `npm run lint` and `npm test` before submitting pull requests.
- Make sure that **100%** of your code is covered by tests.
- If you're adding **new** algorithms or data structures please provide **README.md** for each of them **with explanations** of the algorithm and **with links** to further readings.

**Contributing New Translation**

- Create new `README.xx-XX.md` file with translation alongside with
main `README.md` file where `xx-XX` is [locale and country/region codes](http://www.lingoes.net/en/translator/langcode.htm).
For example `en-US`, `zh-CN`, `zh-TW`, `ko-KR` etc.
- You may also translate all other sub-folders by creating
related `README.xx-XX.md` files in each of them.

**Contributing New Algorithms**

- Make your pull requests to be **specific** and **focused**. Instead of
contributing "several sorting algorithms" all at once contribute them all
one by one separately (i.e. one pull request for "Quick Sort", another one
for "Heap Sort" and so on).
- Provide **README.md** for each of the algorithms **with explanations** of
the algorithm and **with links** to further readings.
- Describe what you do in code using **comments**.
Loading