diff --git a/src/algorithms/cryptography/polynomial-hash/__test__/PolynomialHash.test.js b/src/algorithms/cryptography/polynomial-hash/__test__/PolynomialHash.test.js index 0d487848dc..960ff03864 100644 --- a/src/algorithms/cryptography/polynomial-hash/__test__/PolynomialHash.test.js +++ b/src/algorithms/cryptography/polynomial-hash/__test__/PolynomialHash.test.js @@ -21,12 +21,12 @@ describe('PolynomialHash', () => { // Check hashing for different word lengths. frameSizes.forEach((frameSize) => { - let previousWord = text.substr(0, frameSize); + let previousWord = text.substring(0, frameSize); let previousHash = polynomialHash.hash(previousWord); // Shift frame through the whole text. for (let frameShift = 1; frameShift < (text.length - frameSize); frameShift += 1) { - const currentWord = text.substr(frameShift, frameSize); + const currentWord = text.substring(frameShift, frameShift + frameSize); const currentHash = polynomialHash.hash(currentWord); const currentRollingHash = polynomialHash.roll(previousHash, previousWord, currentWord); diff --git a/src/algorithms/cryptography/polynomial-hash/__test__/SimplePolynomialHash.test.js b/src/algorithms/cryptography/polynomial-hash/__test__/SimplePolynomialHash.test.js index 28c551966d..ffb7530387 100644 --- a/src/algorithms/cryptography/polynomial-hash/__test__/SimplePolynomialHash.test.js +++ b/src/algorithms/cryptography/polynomial-hash/__test__/SimplePolynomialHash.test.js @@ -18,12 +18,12 @@ describe('PolynomialHash', () => { // Check hashing for different word lengths. frameSizes.forEach((frameSize) => { - let previousWord = text.substr(0, frameSize); + let previousWord = text.substring(0, frameSize); let previousHash = polynomialHash.hash(previousWord); // Shift frame through the whole text. for (let frameShift = 1; frameShift < (text.length - frameSize); frameShift += 1) { - const currentWord = text.substr(frameShift, frameSize); + const currentWord = text.substring(frameShift, frameShift + frameSize); const currentHash = polynomialHash.hash(currentWord); const currentRollingHash = polynomialHash.roll(previousHash, previousWord, currentWord); diff --git a/src/algorithms/image-processing/seam-carving/README.md b/src/algorithms/image-processing/seam-carving/README.md index 87004f7abe..6eee9fe6ca 100644 --- a/src/algorithms/image-processing/seam-carving/README.md +++ b/src/algorithms/image-processing/seam-carving/README.md @@ -440,7 +440,7 @@ const findLowEnergySeam = (energyMap: EnergyMap, { w, h }: ImageSize): Seam => { } } - // Find the lowest energy energy seam. + // Find the lowest energy seam. // Once we know where the tail is we may traverse and assemble the lowest // energy seam based on the "previous" value of the seam pixel metadata. const seam: Seam = []; diff --git a/src/algorithms/image-processing/seam-carving/README.ru-RU.md b/src/algorithms/image-processing/seam-carving/README.ru-RU.md index 444ce6df61..a6c279b8fb 100644 --- a/src/algorithms/image-processing/seam-carving/README.ru-RU.md +++ b/src/algorithms/image-processing/seam-carving/README.ru-RU.md @@ -440,7 +440,7 @@ const findLowEnergySeam = (energyMap: EnergyMap, { w, h }: ImageSize): Seam => { } } - // Find the lowest energy energy seam. + // Find the lowest energy seam. // Once we know where the tail is we may traverse and assemble the lowest // energy seam based on the "previous" value of the seam pixel metadata. const seam: Seam = []; diff --git a/src/algorithms/image-processing/seam-carving/resizeImageWidth.js b/src/algorithms/image-processing/seam-carving/resizeImageWidth.js index 9f2c92fcee..c4eeafa609 100644 --- a/src/algorithms/image-processing/seam-carving/resizeImageWidth.js +++ b/src/algorithms/image-processing/seam-carving/resizeImageWidth.js @@ -170,7 +170,7 @@ const findLowEnergySeam = (energyMap, { w, h }) => { } } - // Find the lowest energy energy seam. + // Find the lowest energy seam. // Once we know where the tail is we may traverse and assemble the lowest // energy seam based on the "previous" value of the seam pixel metadata. const seam = []; diff --git a/src/algorithms/math/fibonacci/fibonacciNthClosedForm.js b/src/algorithms/math/fibonacci/fibonacciNthClosedForm.js index e2a2a367cb..a81efbe3d7 100644 --- a/src/algorithms/math/fibonacci/fibonacciNthClosedForm.js +++ b/src/algorithms/math/fibonacci/fibonacciNthClosedForm.js @@ -2,7 +2,7 @@ * Calculate fibonacci number at specific position using closed form function (Binet's formula). * @see: https://en.wikipedia.org/wiki/Fibonacci_number#Closed-form_expression * - * @param {number} position - Position number of fibonacci sequence (must be number from 1 to 75). + * @param {number} position - Position number of fibonacci sequence (must be number from 1 to 70). * @return {number} */ export default function fibonacciClosedForm(position) { diff --git a/src/algorithms/sorting/insertion-sort/README.pt-BR.md b/src/algorithms/sorting/insertion-sort/README.pt-BR.md index a36d2742be..abe93c2f1e 100644 --- a/src/algorithms/sorting/insertion-sort/README.pt-BR.md +++ b/src/algorithms/sorting/insertion-sort/README.pt-BR.md @@ -3,7 +3,7 @@ _Leia isso em outros idiomas:_ [_English_](README.md) -A ordenação por inserção é um algoritmo de ordenação simples que criaa matriz classificada final (ou lista) um item de cada vez. +A ordenação por inserção é um algoritmo de ordenação simples que cria a matriz classificada final (ou lista) um item de cada vez. É muito menos eficiente em grandes listas do que mais algoritmos avançados, como quicksort, heapsort ou merge ordenar. diff --git a/src/algorithms/string/rabin-karp/rabinKarp.js b/src/algorithms/string/rabin-karp/rabinKarp.js index 9084eb4084..65c3e44859 100644 --- a/src/algorithms/string/rabin-karp/rabinKarp.js +++ b/src/algorithms/string/rabin-karp/rabinKarp.js @@ -32,7 +32,7 @@ export default function rabinKarp(text, word) { // In case of hash collision the strings may not be equal. if ( wordHash === currentFrameHash - && text.substr(charIndex, word.length) === word + && text.substring(charIndex, charIndex + word.length) === word ) { return charIndex; } diff --git a/src/algorithms/string/z-algorithm/zAlgorithm.js b/src/algorithms/string/z-algorithm/zAlgorithm.js index 4b96a4fcc6..57942522ab 100644 --- a/src/algorithms/string/z-algorithm/zAlgorithm.js +++ b/src/algorithms/string/z-algorithm/zAlgorithm.js @@ -48,7 +48,7 @@ function buildZArray(zString) { } // Now we may calculate how many characters starting from current position - // are are the same as the prefix. We may calculate it by difference between + // are the same as the prefix. We may calculate it by difference between // right and left Z box boundaries. zArray[charIndex] = zBoxRightIndex - zBoxLeftIndex; diff --git a/src/data-structures/graph/__test__/Graph.test.js b/src/data-structures/graph/__test__/Graph.test.js index c3df71ab23..111f4ad495 100644 --- a/src/data-structures/graph/__test__/Graph.test.js +++ b/src/data-structures/graph/__test__/Graph.test.js @@ -261,7 +261,7 @@ describe('Graph', () => { expect(graph.getAllEdges()[1].getKey()).toBe(edgeAC.getKey()); }); - it('should should throw an error when trying to delete not existing edge', () => { + it('should throw an error when trying to delete not existing edge', () => { function deleteNotExistingEdge() { const graph = new Graph(); diff --git a/src/data-structures/linked-list/README.pt-BR.md b/src/data-structures/linked-list/README.pt-BR.md index 579a4fce8c..5d72432887 100644 --- a/src/data-structures/linked-list/README.pt-BR.md +++ b/src/data-structures/linked-list/README.pt-BR.md @@ -149,7 +149,7 @@ end ReverseTraversal | :----: | :------: | :------: | :-----: | | O(n) | O(n) | O(1) | O(n) | -### Complexidade de Espaçø +### Complexidade de Espaço O(n) diff --git a/src/data-structures/queue/README.pt-BR.md b/src/data-structures/queue/README.pt-BR.md index 9464864120..c8aa2ae39a 100644 --- a/src/data-structures/queue/README.pt-BR.md +++ b/src/data-structures/queue/README.pt-BR.md @@ -18,13 +18,13 @@ um exemplo de uma estrutura de dados linear, ou mais abstratamente uma coleção seqüencial. -Representação de uma file FIFO (first in, first out) +Representação de uma fila FIFO (first in, first out) ![Queue](./images/queue.jpeg) *Made with [okso.app](https://okso.app)* -## References +## Referências - [Wikipedia](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) - [YouTube](https://www.youtube.com/watch?v=wjI1WNcIntg&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8&index=3&)