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: amiashraf/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
Loading
Showing with 15,335 additions and 3,068 deletions.
  1. +2 −1 .eslintrc
  2. +1 −1 .github/workflows/CI.yml
  3. +1 −1 .nvmrc
  4. +18 −0 BACKERS.md
  5. +4 −2 README.ar-AR.md
  6. +3 −1 README.de-DE.md
  7. +4 −2 README.es-ES.md
  8. +3 −1 README.fr-FR.md
  9. +370 −0 README.he-IL.md
  10. +3 −1 README.id-ID.md
  11. +3 −1 README.it-IT.md
  12. +3 −1 README.ja-JP.md
  13. +3 −1 README.ko-KR.md
  14. +34 −20 README.md
  15. +3 −1 README.pl-PL.md
  16. +115 −106 README.pt-BR.md
  17. +3 −1 README.ru-RU.md
  18. +3 −1 README.tr-TR.md
  19. +3 −1 README.uk-UA.md
  20. +359 −0 README.uz-UZ.md
  21. +21 −20 README.vi-VN.md
  22. +3 −1 README.zh-CN.md
  23. +3 −1 README.zh-TW.md
  24. +3 −1 jest.config.js
  25. +11,252 −2,622 package-lock.json
  26. +12 −13 package.json
  27. +2 −2 src/algorithms/graph/breadth-first-search/README.md
  28. +85 −0 src/algorithms/image-processing/seam-carving/__tests__/resizeImageWidth.node.js
  29. +0 −91 src/algorithms/image-processing/seam-carving/__tests__/resizeImageWidth.test.js
  30. BIN src/algorithms/image-processing/seam-carving/__tests__/test-image-after.jpg
  31. BIN src/algorithms/image-processing/seam-carving/__tests__/test-image-after.png
  32. BIN src/algorithms/image-processing/seam-carving/__tests__/test-image-before.jpg
  33. BIN src/algorithms/image-processing/seam-carving/__tests__/test-image-before.png
  34. +2 −1 src/algorithms/linked-list/reverse-traversal/README.md
  35. +23 −0 src/algorithms/linked-list/reverse-traversal/README.pt-BR.md
  36. +2 −1 src/algorithms/linked-list/traversal/README.md
  37. +24 −0 src/algorithms/linked-list/traversal/README.pt-BR.md
  38. +32 −0 src/algorithms/math/factorial/README.ka-GE.md
  39. +1 −1 src/algorithms/math/factorial/README.md
  40. +33 −0 src/algorithms/math/factorial/README.uk-UA.md
  41. +2 −1 src/algorithms/math/fibonacci/README.fr-FR.md
  42. +20 −0 src/algorithms/math/fibonacci/README.ka-GE.md
  43. +2 −1 src/algorithms/math/fibonacci/README.md
  44. +2 −1 src/algorithms/math/fibonacci/README.zh-CN.md
  45. +8 −0 src/algorithms/ml/k-means/README.md
  46. +35 −0 src/algorithms/ml/k-means/README.pt-BR.md
  47. +3 −0 src/algorithms/ml/knn/README.md
  48. +44 −0 src/algorithms/ml/knn/README.pt-BR.md
  49. +27 −0 src/algorithms/search/binary-search/README.es-ES.md
  50. +9 −8 src/algorithms/search/binary-search/README.md
  51. +1 −0 src/algorithms/search/binary-search/README.pt-BR.md
  52. +1 −1 src/algorithms/search/binary-search/binarySearch.js
  53. +15 −17 src/algorithms/sets/combinations/README.md
  54. BIN src/algorithms/sets/combinations/images/combinations-overview.jpg
  55. BIN src/algorithms/sets/combinations/images/combinations-with-repetitions.jpg
  56. BIN src/algorithms/sets/combinations/images/combinations-without-repetitions.jpg
  57. BIN src/algorithms/sets/combinations/images/overview.png
  58. +17 −0 src/algorithms/sets/longest-common-subsequence/__test__/longestCommonSubsequenceRecursive.test.js
  59. +36 −0 src/algorithms/sets/longest-common-subsequence/longestCommonSubsequenceRecursive.js
  60. +10 −12 src/algorithms/sets/permutations/README.md
  61. BIN src/algorithms/sets/permutations/images/overview.png
  62. BIN src/algorithms/sets/permutations/images/permutations-overview.jpeg
  63. BIN src/algorithms/sets/permutations/images/permutations-with-repetitions.jpg
  64. BIN src/algorithms/sets/permutations/images/permutations-without-repetitions.jpg
  65. +49 −11 src/algorithms/sets/power-set/README.md
  66. +28 −0 src/algorithms/sets/power-set/__test__/caPowerSet.test.js
  67. +37 −0 src/algorithms/sets/power-set/caPowerSet.js
  68. +7 −4 src/algorithms/sorting/bubble-sort/README.pt-BR.md
  69. +46 −0 src/algorithms/sorting/bucket-sort/BucketSort.js
  70. +35 −0 src/algorithms/sorting/bucket-sort/README.md
  71. +33 −0 src/algorithms/sorting/bucket-sort/__test__/BucketSort.test.js
  72. BIN src/algorithms/sorting/bucket-sort/images/bucket_sort_1.png
  73. BIN src/algorithms/sorting/bucket-sort/images/bucket_sort_2.png
  74. +3 −0 src/algorithms/sorting/counting-sort/README.md
  75. +70 −0 src/algorithms/sorting/counting-sort/README.pt-br.md
  76. +3 −0 src/algorithms/sorting/heap-sort/README.md
  77. +20 −0 src/algorithms/sorting/heap-sort/README.pt-BR.md
  78. +3 −0 src/algorithms/sorting/insertion-sort/README.md
  79. +22 −0 src/algorithms/sorting/insertion-sort/README.pt-BR.md
  80. +2 −1 src/algorithms/sorting/merge-sort/README.md
  81. +38 −0 src/algorithms/sorting/merge-sort/README.pt-BR.md
  82. +1 −1 src/algorithms/sorting/quick-sort/QuickSortInPlace.js
  83. +2 −2 src/algorithms/sorting/quick-sort/README.md
  84. +8 −4 src/algorithms/sorting/quick-sort/README.pt-BR.md
  85. +22 −19 src/algorithms/sorting/radix-sort/README.md
  86. +48 −0 src/algorithms/sorting/radix-sort/README.pt-BR.md
  87. BIN src/algorithms/sorting/radix-sort/images/radix-sort.png
  88. +1 −1 src/algorithms/sorting/selection-sort/README.md
  89. +2 −2 src/algorithms/sorting/selection-sort/README.pt-BR.md
  90. +3 −0 src/algorithms/sorting/shell-sort/README.md
  91. +60 −0 src/algorithms/sorting/shell-sort/README.pt-BR.md
  92. +44 −0 src/algorithms/stack/valid-parentheses/README.md
  93. +23 −0 src/algorithms/stack/valid-parentheses/__test__/validParentheses.test.js
  94. +42 −0 src/algorithms/stack/valid-parentheses/validParentheses.js
  95. +2 −0 src/algorithms/string/longest-common-substring/__test__/longestCommonSubstring.test.js
  96. +2 −0 src/algorithms/string/longest-common-substring/longestCommonSubstring.js
  97. +1 −1 src/algorithms/uncategorized/best-time-to-buy-sell-stocks/README.md
  98. +1 −1 src/algorithms/uncategorized/n-queens/README.md
  99. +20 −19 src/data-structures/bloom-filter/README.md
  100. +2 −2 src/data-structures/bloom-filter/README.pt-BR.md
  101. +54 −0 src/data-structures/bloom-filter/README.uk-UA.md
  102. +78 −0 src/data-structures/disjoint-set/DisjointSetAdhoc.js
  103. +13 −8 src/data-structures/disjoint-set/README.md
  104. +5 −5 src/data-structures/disjoint-set/README.pt-BR.md
  105. +22 −0 src/data-structures/disjoint-set/README.uk-UA.md
  106. +50 −0 src/data-structures/disjoint-set/__test__/DisjointSetAdhoc.test.js
  107. +5 −4 src/data-structures/doubly-linked-list/README.md
  108. +3 −3 src/data-structures/doubly-linked-list/README.pt-BR.md
  109. +109 −0 src/data-structures/doubly-linked-list/README.uk-UA.md
  110. +3 −1 src/data-structures/graph/README.md
  111. +24 −0 src/data-structures/graph/README.uk-UA.md
  112. +6 −5 src/data-structures/hash-table/README.md
  113. +2 −2 src/data-structures/hash-table/README.pt-BR.md
  114. +29 −0 src/data-structures/hash-table/README.uk-UA.md
  115. +1 −1 src/data-structures/heap/Heap.js
  116. +115 −0 src/data-structures/heap/MaxHeapAdhoc.js
  117. +117 −0 src/data-structures/heap/MinHeapAdhoc.js
  118. +33 −1 src/data-structures/heap/README.md
  119. +25 −0 src/data-structures/heap/README.uk-UA.md
  120. +91 −0 src/data-structures/heap/__test__/MaxHeapAdhoc.test.js
  121. +91 −0 src/data-structures/heap/__test__/MinHeapAdhoc.test.js
  122. +6 −6 src/data-structures/linked-list/README.es-ES.md
  123. +2 −1 src/data-structures/linked-list/README.md
  124. +147 −0 src/data-structures/linked-list/README.uk-UA.md
  125. +155 −0 src/data-structures/linked-list/README.vi-VN.md
  126. +153 −0 src/data-structures/lru-cache/LRUCache.js
  127. +53 −0 src/data-structures/lru-cache/LRUCacheOnMap.js
  128. +51 −0 src/data-structures/lru-cache/README.ko-KR.md
  129. +54 −0 src/data-structures/lru-cache/README.md
  130. +150 −0 src/data-structures/lru-cache/__test__/LRUCache.test.js
  131. +148 −0 src/data-structures/lru-cache/__test__/LRUCacheOnMap.test.js
  132. BIN src/data-structures/lru-cache/images/lru-cache.jpg
  133. +10 −9 src/data-structures/priority-queue/README.md
  134. +4 −4 src/data-structures/priority-queue/README.pt-BR.md
  135. +21 −0 src/data-structures/priority-queue/README.uk-UA.md
  136. +2 −1 src/data-structures/queue/README.md
  137. +21 −0 src/data-structures/queue/README.uk-UA.md
  138. +22 −0 src/data-structures/queue/README.vi-VN.md
  139. +2 −1 src/data-structures/stack/README.md
  140. +4 −4 src/data-structures/stack/README.pt-BR.md
  141. +25 −0 src/data-structures/stack/README.uk-UA.md
  142. +27 −0 src/data-structures/stack/README.vi-VN.md
  143. +1 −1 src/data-structures/tree/README.md
  144. +1 −1 src/data-structures/tree/README.pt-BR.md
  145. +19 −0 src/data-structures/trie/README.ko-KO.md
  146. +3 −1 src/data-structures/trie/README.md
  147. +3 −3 src/data-structures/trie/README.pt-BR.md
  148. +27 −0 src/data-structures/trie/README.uk-UA.md
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -12,9 +12,10 @@
"arrow-body-style": "off",
"no-loop-func": "off"
},
"ignorePatterns": ["*.md", "*.png", "*.jpeg", "*.jpg"],
"settings": {
"react": {
"version": "latest"
"version": "18.2.0"
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x ]
node-version: [ 16.x ]

steps:
- name: Checkout repository
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14
v16.15.0
18 changes: 18 additions & 0 deletions BACKERS.md
Original file line number Diff line number Diff line change
@@ -14,6 +14,24 @@

`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>
6 changes: 4 additions & 2 deletions README.ar-AR.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/trekhleb/javascript-algorithms.svg?branch=master)](https://travis-ci.org/trekhleb/javascript-algorithms)
[![codecov](https://codecov.io/gh/trekhleb/javascript-algorithms/branch/master/graph/badge.svg)](https://codecov.io/gh/trekhleb/javascript-algorithms)

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

كل خوارزمية وهياكل البيانات لها برنامج README منفصل خاص بها
مع التفسيرات والروابط ذات الصلة لمزيد من القراءة (بما في ذلك تلك
@@ -23,7 +23,9 @@ _اقرأ هذا في لغات أخرى:_
[_Türk_](README.tr-TR.md),
[_Italiana_](README.it-IT.md),
[_Tiếng Việt_](README.vi-VN.md),
[_Deutsch_](README.de-DE.md)
[_Deutsch_](README.de-DE.md),
[_Uzbek_](README.uz-UZ.md)
[_עברית_](README.he-IL.md)

☝ ملاحضة هذا المشروع مخصص للاستخدام لأغراض التعلم والبحث
فقط ، و ** ليست ** معدة للاستخدام في **الإنتاج**
4 changes: 3 additions & 1 deletion README.de-DE.md
Original file line number Diff line number Diff line change
@@ -24,7 +24,9 @@ _Lies dies in anderen Sprachen:_
[_Italiana_](README.it-IT.md),
[_Bahasa Indonesia_](README.id-ID.md),
[_Українська_](README.uk-UA.md),
[_Arabic_](README.ar-AR.md)
[_Arabic_](README.ar-AR.md),
[_Uzbek_](README.uz-UZ.md)
[_עברית_](README.he-IL.md)

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

6 changes: 4 additions & 2 deletions README.es-ES.md
Original file line number Diff line number Diff line change
@@ -25,7 +25,9 @@ _Léelo en otros idiomas:_
[_Українська_](README.uk-UA.md),
[_Arabic_](README.ar-AR.md),
[_Tiếng Việt_](README.vi-VN.md),
[_Deutsch_](README.de-DE.md)
[_Deutsch_](README.de-DE.md),
[_Uzbek_](README.uz-UZ.md)
[_עברית_](README.he-IL.md)

*☝ Nótese que este proyecto está pensado con fines de aprendizaje e investigación,
y **no** para ser usado en producción.*
@@ -69,7 +71,7 @@ definen con precisión una secuencia de operaciones.
* **Matemáticas**
* `P` [Manipulación de bits](src/algorithms/math/bits) - asignar/obtener/actualizar/limpiar bits, multiplicación/división por dos, hacer negativo, etc.
* `P` [Factorial](src/algorithms/math/factorial)
* `P` [Número de Fibonacci](src/algorithms/math/fibonacci)
* `P` [Sucesión de Fibonacci](src/algorithms/math/fibonacci)
* `P` [Prueba de primalidad](src/algorithms/math/primality-test) (método de división de prueba)
* `P` [Algoritmo de Euclides](src/algorithms/math/euclidean-algorithm) - calcular el Máximo común divisor (MCD)
* `P` [Mínimo común múltiplo](src/algorithms/math/least-common-multiple) (MCM)
4 changes: 3 additions & 1 deletion README.fr-FR.md
Original file line number Diff line number Diff line change
@@ -26,7 +26,9 @@ _Lisez ceci dans d'autres langues:_
[_Українська_](README.uk-UA.md),
[_Arabic_](README.ar-AR.md),
[_Tiếng Việt_](README.vi-VN.md),
[_Deutsch_](README.de-DE.md)
[_Deutsch_](README.de-DE.md),
[_Uzbek_](README.uz-UZ.md)
[_עברית_](README.he-IL.md)

## Data Structures

Loading