Skip to content

Commit a6ad2d8

Browse files
authored
Merge pull request #1 from trekhleb/master
merge master
2 parents 30ae323 + 8335707 commit a6ad2d8

File tree

439 files changed

+30989
-7841
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

439 files changed

+30989
-7841
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["env"]
2+
"presets": ["@babel/preset-env"]
33
}

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# @see: https://editorconfig.org/
12
root = true
23

34
[*]
@@ -6,3 +7,4 @@ insert_final_newline = true
67
charset = utf-8
78
indent_style = space
89
indent_size = 2
10+
trim_trailing_whitespace = true

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @see: https://docs.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository
2+
github: trekhleb
3+
patreon: trekhleb

.github/workflows/CI.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [ 14.x ]
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
20+
- name: Setup Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- name: Install dependencies
26+
run: npm i
27+
28+
- name: Run linting
29+
run: npm run lint
30+
31+
- name: Run tests
32+
run: npm run coverage
33+
34+
- name: Upload coverage to Codecov
35+
uses: codecov/codecov-action@v1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules
22
.idea
33
coverage
4+
.vscode
5+
.DS_Store

.huskyrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "npm run lint && npm run test"
4+
}
5+
}

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

BACKERS.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Project Backers
2+
3+
> You may support this project via ❤️️ [GitHub](https://github.com/sponsors/trekhleb) or ❤️️ [Patreon](https://www.patreon.com/trekhleb).
4+
5+
## `O(2ⁿ)` Backers
6+
7+
`null`
8+
9+
## `O(n²)` Backers
10+
11+
`null`
12+
13+
## `O(n×log(n))` Backers
14+
15+
`null`
16+
17+
<!--
18+
<ul>
19+
<li>
20+
<a href="[PROFILE_URL]">
21+
<img
22+
src="[PROFILE_IMG_SRC]"
23+
width="30"
24+
height="30"
25+
/></a>
26+
&thinsp;
27+
<a href="[PROFILE_URL]">[PROFILE_NAME]</a>
28+
</li>
29+
</ul>
30+
-->

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
## Contributing
22

3+
**General Rules**
4+
35
- As much as possible, try to follow the existing format of markdown and code.
46
- Don't forget to run `npm run lint` and `npm test` before submitting pull requests.
57
- Make sure that **100%** of your code is covered by tests.
8+
9+
**Contributing New Translation**
10+
11+
- Create new `README.xx-XX.md` file with translation alongside with
12+
main `README.md` file where `xx-XX` is [locale and country/region codes](http://www.lingoes.net/en/translator/langcode.htm).
13+
For example `en-US`, `zh-CN`, `zh-TW`, `ko-KR` etc.
14+
- You may also translate all other sub-folders by creating
15+
related `README.xx-XX.md` files in each of them.
16+
17+
**Contributing New Algorithms**
18+
19+
- Make your pull requests to be **specific** and **focused**. Instead of
20+
contributing "several sorting algorithms" all at once contribute them all
21+
one by one separately (i.e. one pull request for "Quick Sort", another one
22+
for "Heap Sort" and so on).
23+
- Provide **README.md** for each of the algorithms **with explanations** of
24+
the algorithm and **with links** to further readings.
25+
- Describe what you do in code using **comments**.

README.ar-AR.md

Lines changed: 322 additions & 0 deletions
Large diffs are not rendered by default.

README.es-ES.md

Lines changed: 300 additions & 0 deletions
Large diffs are not rendered by default.

README.fr-FR.md

Lines changed: 294 additions & 0 deletions
Large diffs are not rendered by default.

README.id-ID.md

Lines changed: 305 additions & 0 deletions
Large diffs are not rendered by default.

README.it-IT.md

Lines changed: 298 additions & 0 deletions
Large diffs are not rendered by default.

README.ja-JP.md

Lines changed: 297 additions & 0 deletions
Large diffs are not rendered by default.

README.ko-KR.md

Lines changed: 278 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 241 additions & 139 deletions
Large diffs are not rendered by default.

README.pl-PL.md

Lines changed: 290 additions & 0 deletions
Large diffs are not rendered by default.

README.pt-BR.md

Lines changed: 291 additions & 0 deletions
Large diffs are not rendered by default.

README.ru-RU.md

Lines changed: 296 additions & 0 deletions
Large diffs are not rendered by default.

README.tr-TR.md

Lines changed: 316 additions & 0 deletions
Large diffs are not rendered by default.

README.uk-UA.md

Lines changed: 306 additions & 0 deletions
Large diffs are not rendered by default.

README.zh-CN.md

Lines changed: 210 additions & 133 deletions
Large diffs are not rendered by default.

README.zh-TW.md

Lines changed: 122 additions & 112 deletions
Large diffs are not rendered by default.

assets/big-o-graph.png

-28.6 KB
Loading

jest.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
module.exports = {
2+
// The bail config option can be used here to have Jest stop running tests after
3+
// the first failure.
4+
bail: false,
5+
6+
// Indicates whether each individual test should be reported during the run.
27
verbose: false,
8+
9+
// Indicates whether the coverage information should be collected while executing the test
310
collectCoverage: false,
11+
12+
// The directory where Jest should output its coverage files.
413
coverageDirectory: './coverage/',
14+
15+
// If the test path matches any of the patterns, it will be skipped.
16+
testPathIgnorePatterns: ['<rootDir>/node_modules/'],
17+
18+
// If the file path matches any of the patterns, coverage information will be skipped.
19+
coveragePathIgnorePatterns: ['<rootDir>/node_modules/'],
20+
21+
// The pattern Jest uses to detect test files.
22+
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$',
23+
24+
// This option sets the URL for the jsdom environment.
25+
// It is reflected in properties such as location.href.
26+
// @see: https://github.com/facebook/jest/issues/6769
27+
testURL: 'http://localhost/',
28+
29+
// @see: https://jestjs.io/docs/en/configuration#coveragethreshold-object
30+
coverageThreshold: {
31+
global: {
32+
statements: 100,
33+
branches: 95,
34+
functions: 100,
35+
lines: 100,
36+
},
37+
},
538
};

0 commit comments

Comments
 (0)