Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/image-processing/seam-carving/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/math/fibonacci/fibonacciNthClosedForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/sorting/insertion-sort/README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/string/rabin-karp/rabinKarp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/string/z-algorithm/zAlgorithm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/data-structures/graph/__test__/Graph.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/data-structures/linked-list/README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ end ReverseTraversal
| :----: | :------: | :------: | :-----: |
| O(n) | O(n) | O(1) | O(n) |

### Complexidade de Espaçø
### Complexidade de Espaço

O(n)

Expand Down
4 changes: 2 additions & 2 deletions src/data-structures/queue/README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -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&)
Loading