Skip to content

Commit 18c5477

Browse files
authored
Merge branch 'master' into master
2 parents 74beb75 + 0e2b257 commit 18c5477

File tree

197 files changed

+15108
-3230
lines changed

Some content is hidden

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

197 files changed

+15108
-3230
lines changed

.eslintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
"arrow-body-style": "off",
1313
"no-loop-func": "off"
1414
},
15+
"ignorePatterns": ["*.md", "*.png", "*.jpeg", "*.jpg"],
1516
"settings": {
1617
"react": {
17-
"version": "latest"
18+
"version": "18.2.0"
1819
}
1920
}
2021
}

.github/workflows/CI.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node-version: [ 14.x ]
14+
node-version: [ 16.x ]
1515

1616
steps:
1717
- name: Checkout repository

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v14
1+
v16.15.0

BACKERS.md

+18
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@
1414

1515
`null`
1616

17+
<!--
18+
<table>
19+
<tr>
20+
<td align="center">
21+
<a href="[PROFILE_URL]">
22+
<img
23+
src="[PROFILE_IMG_SRC]"
24+
width="50"
25+
height="50"
26+
/>
27+
</a>
28+
<br />
29+
<a href="[PROFILE_URL]">[PROFILE_NAME]</a>
30+
</td>
31+
</tr>
32+
</table>
33+
-->
34+
1735
<!--
1836
<ul>
1937
<li>

README.ar-AR.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://travis-ci.org/trekhleb/javascript-algorithms.svg?branch=master)](https://travis-ci.org/trekhleb/javascript-algorithms)
44
[![codecov](https://codecov.io/gh/trekhleb/javascript-algorithms/branch/master/graph/badge.svg)](https://codecov.io/gh/trekhleb/javascript-algorithms)
55

6-
تحتوي هذا مقالة على أمثلة عديدة تستند إلى الخوارزميات الشائعة وهياكل البيانات في الجافا سكريبت.
6+
تحتوي هذه المقالة على أمثلة عديدة تستند إلى الخوارزميات الشائعة وهياكل البيانات في الجافا سكريبت.
77

88
كل خوارزمية وهياكل البيانات لها برنامج README منفصل خاص بها
99
مع التفسيرات والروابط ذات الصلة لمزيد من القراءة (بما في ذلك تلك
@@ -23,7 +23,8 @@ _اقرأ هذا في لغات أخرى:_
2323
[_Türk_](README.tr-TR.md),
2424
[_Italiana_](README.it-IT.md),
2525
[_Tiếng Việt_](README.vi-VN.md),
26-
[_Deutsch_](README.de-DE.md)
26+
[_Deutsch_](README.de-DE.md),
27+
[_Uzbek_](README.uz-UZ.md)
2728

2829
☝ ملاحضة هذا المشروع مخصص للاستخدام لأغراض التعلم والبحث
2930
فقط ، و ** ليست ** معدة للاستخدام في **الإنتاج**

README.de-DE.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ _Lies dies in anderen Sprachen:_
2424
[_Italiana_](README.it-IT.md),
2525
[_Bahasa Indonesia_](README.id-ID.md),
2626
[_Українська_](README.uk-UA.md),
27-
[_Arabic_](README.ar-AR.md)
27+
[_Arabic_](README.ar-AR.md),
28+
[_Uzbek_](README.uz-UZ.md)
2829

2930
_☝ Beachte, dass dieses Projekt nur für Lern- und Forschungszwecke gedacht ist und **nicht** für den produktiven Einsatz verwendet werden soll_
3031

README.es-ES.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ _Léelo en otros idiomas:_
2525
[_Українська_](README.uk-UA.md),
2626
[_Arabic_](README.ar-AR.md),
2727
[_Tiếng Việt_](README.vi-VN.md),
28-
[_Deutsch_](README.de-DE.md)
28+
[_Deutsch_](README.de-DE.md),
29+
[_Uzbek_](README.uz-UZ.md)
2930

3031
*☝ Nótese que este proyecto está pensado con fines de aprendizaje e investigación,
3132
y **no** para ser usado en producción.*
@@ -69,7 +70,7 @@ definen con precisión una secuencia de operaciones.
6970
* **Matemáticas**
7071
* `P` [Manipulación de bits](src/algorithms/math/bits) - asignar/obtener/actualizar/limpiar bits, multiplicación/división por dos, hacer negativo, etc.
7172
* `P` [Factorial](src/algorithms/math/factorial)
72-
* `P` [Número de Fibonacci](src/algorithms/math/fibonacci)
73+
* `P` [Sucesión de Fibonacci](src/algorithms/math/fibonacci)
7374
* `P` [Prueba de primalidad](src/algorithms/math/primality-test) (método de división de prueba)
7475
* `P` [Algoritmo de Euclides](src/algorithms/math/euclidean-algorithm) - calcular el Máximo común divisor (MCD)
7576
* `P` [Mínimo común múltiplo](src/algorithms/math/least-common-multiple) (MCM)

README.fr-FR.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ _Lisez ceci dans d'autres langues:_
2626
[_Українська_](README.uk-UA.md),
2727
[_Arabic_](README.ar-AR.md),
2828
[_Tiếng Việt_](README.vi-VN.md),
29-
[_Deutsch_](README.de-DE.md)
29+
[_Deutsch_](README.de-DE.md),
30+
[_Uzbek_](README.uz-UZ.md)
3031

3132
## Data Structures
3233

README.id-ID.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ _Baca ini dalam bahasa yang lain:_
2323
[_Українська_](README.uk-UA.md),
2424
[_Arabic_](README.ar-AR.md),
2525
[_Tiếng Việt_](README.vi-VN.md),
26-
[_Deutsch_](README.de-DE.md)
26+
[_Deutsch_](README.de-DE.md),
27+
[_Uzbek_](README.uz-UZ.md)
2728

2829
_☝ Perhatikan bahwa proyek ini hanya dimaksudkan untuk tujuan pembelajaran dan riset, dan **tidak** dimaksudkan untuk digunakan sebagai produksi._
2930

README.it-IT.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ _Leggilo in altre lingue:_
2222
[_Українська_](README.uk-UA.md),
2323
[_Arabic_](README.ar-AR.md),
2424
[_Tiếng Việt_](README.vi-VN.md),
25-
[_Deutsch_](README.de-DE.md)
25+
[_Deutsch_](README.de-DE.md),
26+
[_Uzbek_](README.uz-UZ.md)
2627

2728
*☝ Si noti che questo progetto è destinato ad essere utilizzato solo per l'apprendimento e la ricerca e non è destinato ad essere utilizzato per il commercio.*
2829

README.ja-JP.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ _Read this in other languages:_
2525
[_Українська_](README.uk-UA.md),
2626
[_Arabic_](README.ar-AR.md),
2727
[_Tiếng Việt_](README.vi-VN.md),
28-
[_Deutsch_](README.de-DE.md)
28+
[_Deutsch_](README.de-DE.md),
29+
[_Uzbek_](README.uz-UZ.md)
2930

3031
## データ構造
3132

README.ko-KR.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ _Read this in other languages:_
2424
[_Українська_](README.uk-UA.md),
2525
[_Arabic_](README.ar-AR.md),
2626
[_Tiếng Việt_](README.vi-VN.md),
27-
[_Deutsch_](README.de-DE.md)
27+
[_Deutsch_](README.de-DE.md),
28+
[_Uzbek_](README.uz-UZ.md)
2829

2930
## 자료 구조
3031

README.md

+27-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# JavaScript Algorithms and Data Structures
22

3-
> 🇺🇦 UKRAINE [IS BEING ATTACKED](https://twitter.com/MFA_Ukraine) BY RUSSIAN ARMY. CIVILIANS ARE GETTING KILLED. RESIDENTIAL AREAS ARE GETTING BOMBED.
4-
> - Help Ukraine via [National Bank of Ukraine](https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi)
5-
> - Help Ukraine via [SaveLife](https://savelife.in.ua/en/donate/) fund
6-
> - More info on [war.ukraine.ua](https://war.ukraine.ua/)
3+
> 🇺🇦 UKRAINE [IS BEING ATTACKED](https://war.ukraine.ua/) BY RUSSIAN ARMY. CIVILIANS ARE GETTING KILLED. RESIDENTIAL AREAS ARE GETTING BOMBED.
4+
> - Help Ukraine via:
5+
> - [Serhiy Prytula Charity Foundation](https://prytulafoundation.org/en/)
6+
> - [Come Back Alive Charity Foundation](https://savelife.in.ua/en/donate-en/)
7+
> - [National Bank of Ukraine](https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi)
8+
> - More info on [war.ukraine.ua](https://war.ukraine.ua/) and [MFA of Ukraine](https://twitter.com/MFA_Ukraine)
9+
10+
<hr/>
711

812
[![CI](https://github.com/trekhleb/javascript-algorithms/workflows/CI/badge.svg)](https://github.com/trekhleb/javascript-algorithms/actions?query=workflow%3ACI+branch%3Amaster)
913
[![codecov](https://codecov.io/gh/trekhleb/javascript-algorithms/branch/master/graph/badge.svg)](https://codecov.io/gh/trekhleb/javascript-algorithms)
14+
![repo size](https://img.shields.io/github/repo-size/trekhleb/javascript-algorithms.svg)
1015

1116
This repository contains JavaScript based examples of many
1217
popular algorithms and data structures.
@@ -31,7 +36,8 @@ _Read this in other languages:_
3136
[_Українська_](README.uk-UA.md),
3237
[_Arabic_](README.ar-AR.md),
3338
[_Tiếng Việt_](README.vi-VN.md),
34-
[_Deutsch_](README.de-DE.md)
39+
[_Deutsch_](README.de-DE.md),
40+
[_Uzbek_](README.uz-UZ.md)
3541

3642
*☝ Note that this project is meant to be used for learning and researching purposes
3743
only, and it is **not** meant to be used for production.*
@@ -43,6 +49,8 @@ be accessed and modified efficiently. More precisely, a data structure is a coll
4349
values, the relationships among them, and the functions or operations that can be applied to
4450
the data.
4551

52+
Remember that each data has its own trade-offs. And you need to pay attention more to why you're choosing a certain data structure than to how to implement it.
53+
4654
`B` - Beginner, `A` - Advanced
4755

4856
* `B` [Linked List](src/data-structures/linked-list)
@@ -60,8 +68,9 @@ the data.
6068
* `A` [Segment Tree](src/data-structures/tree/segment-tree) - with min/max/sum range queries examples
6169
* `A` [Fenwick Tree](src/data-structures/tree/fenwick-tree) (Binary Indexed Tree)
6270
* `A` [Graph](src/data-structures/graph) (both directed and undirected)
63-
* `A` [Disjoint Set](src/data-structures/disjoint-set)
71+
* `A` [Disjoint Set](src/data-structures/disjoint-set) - a union–find data structure or merge–find set
6472
* `A` [Bloom Filter](src/data-structures/bloom-filter)
73+
* `A` [LRU Cache](src/data-structures/lru-cache/) - Least Recently Used (LRU) cache
6574

6675
## Algorithms
6776

@@ -97,7 +106,7 @@ a set of rules that precisely define a sequence of operations.
97106
* **Sets**
98107
* `B` [Cartesian Product](src/algorithms/sets/cartesian-product) - product of multiple sets
99108
* `B` [Fisher–Yates Shuffle](src/algorithms/sets/fisher-yates) - random permutation of a finite sequence
100-
* `A` [Power Set](src/algorithms/sets/power-set) - all subsets of a set (bitwise and backtracking solutions)
109+
* `A` [Power Set](src/algorithms/sets/power-set) - all subsets of a set (bitwise, backtracking, and cascading solutions)
101110
* `A` [Permutations](src/algorithms/sets/permutations) (with and without repetitions)
102111
* `A` [Combinations](src/algorithms/sets/combinations) (with and without repetitions)
103112
* `A` [Longest Common Subsequence](src/algorithms/sets/longest-common-subsequence) (LCS)
@@ -130,6 +139,7 @@ a set of rules that precisely define a sequence of operations.
130139
* `B` [Shellsort](src/algorithms/sorting/shell-sort)
131140
* `B` [Counting Sort](src/algorithms/sorting/counting-sort)
132141
* `B` [Radix Sort](src/algorithms/sorting/radix-sort)
142+
* `B` [Bucket Sort](src/algorithms/sorting/bucket-sort)
133143
* **Linked Lists**
134144
* `B` [Straight Traversal](src/algorithms/linked-list/traversal)
135145
* `B` [Reverse Traversal](src/algorithms/linked-list/reverse-traversal)
@@ -277,14 +287,14 @@ npm test -- 'LinkedList'
277287

278288
**Troubleshooting**
279289

280-
In case if linting or testing is failing try to delete the `node_modules` folder and re-install npm packages:
290+
If linting or testing is failing, try to delete the `node_modules` folder and re-install npm packages:
281291

282292
```
283293
rm -rf ./node_modules
284294
npm i
285295
```
286296

287-
Also make sure that you're using a correct Node version (`>=14.16.0`). If you're using [nvm](https://github.com/nvm-sh/nvm) for Node version management you may run `nvm use` from the root folder of the project and the correct version will be picked up.
297+
Also make sure that you're using a correct Node version (`>=16`). If you're using [nvm](https://github.com/nvm-sh/nvm) for Node version management you may run `nvm use` from the root folder of the project and the correct version will be picked up.
288298

289299
**Playground**
290300

@@ -301,7 +311,8 @@ npm test -- 'playground'
301311

302312
### References
303313

304-
[▶ Data Structures and Algorithms on YouTube](https://www.youtube.com/playlist?list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)
314+
- [▶ Data Structures and Algorithms on YouTube](https://www.youtube.com/playlist?list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)
315+
- [✍🏻 Data Structure Sketches](https://okso.app/showcase/data-structures)
305316

306317
### Big O Notation
307318

@@ -357,6 +368,10 @@ Below is the list of some of the most used Big O notations and their performance
357368

358369
> You may support this project via ❤️️ [GitHub](https://github.com/sponsors/trekhleb) or ❤️️ [Patreon](https://www.patreon.com/trekhleb).
359370
360-
[Folks who are backing this project](https://github.com/trekhleb/javascript-algorithms/blob/master/BACKERS.md) `∑ = 0`
371+
[Folks who are backing this project](https://github.com/trekhleb/javascript-algorithms/blob/master/BACKERS.md) `∑ = 1`
372+
373+
## Author
374+
375+
[@trekhleb](https://trekhleb.dev)
361376

362-
> ℹ️ A few more [projects](https://trekhleb.dev/projects/) and [articles](https://trekhleb.dev/blog/) about JavaScript and algorithms on [trekhleb.dev](https://trekhleb.dev)
377+
A few more [projects](https://trekhleb.dev/projects/) and [articles](https://trekhleb.dev/blog/) about JavaScript and algorithms on [trekhleb.dev](https://trekhleb.dev)

README.pl-PL.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ _Read this in other languages:_
2626
[_Українська_](README.uk-UA.md),
2727
[_Arabic_](README.ar-AR.md),
2828
[_Tiếng Việt_](README.vi-VN.md),
29-
[_Deutsch_](README.de-DE.md)
29+
[_Deutsch_](README.de-DE.md),
30+
[_Uzbek_](README.uz-UZ.md)
3031

3132
## Struktury Danych
3233

0 commit comments

Comments
 (0)