Skip to content

Commit

Permalink
Trim trailing whitespaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
trekhleb committed Dec 16, 2020
1 parent 871d20d commit b13291d
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 75 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# @see: https://editorconfig.org/
root = true

[*]
Expand All @@ -6,3 +7,4 @@ insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
8 changes: 4 additions & 4 deletions README.es-ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Este repositorio contiene ejemplos basados en JavaScript de muchos
algoritmos y estructuras de datos populares.

Cada algoritmo y estructura de datos tiene su propio LÉAME con explicaciones relacionadas y
Cada algoritmo y estructura de datos tiene su propio LÉAME con explicaciones relacionadas y
enlaces para lecturas adicionales (incluyendo algunas a vídeos de YouTube).

_Léelo en otros idiomas:_
Expand Down Expand Up @@ -54,7 +54,7 @@ los datos.

## Algoritmos

Un algoritmo es una especificación inequívoca de cómo resolver una clase de problemas. Es un conjunto de reglas que
Un algoritmo es una especificación inequívoca de cómo resolver una clase de problemas. Es un conjunto de reglas que
definen con precisión una secuencia de operaciones.

`P` - Principiante, `A` - Avanzado
Expand Down Expand Up @@ -231,7 +231,7 @@ npm test -- 'LinkedList'

**Campo de juegos**

Puede jugar con estructuras de datos y algoritmos en el archivo `./src/playground/playground.js` y escribir
Puede jugar con estructuras de datos y algoritmos en el archivo `./src/playground/playground.js` y escribir
pruebas para ello en `./src/playground/__test__/playground.test.js`.

A continuación, simplemente ejecute el siguiente comando para comprobar si el código funciona como se espera:
Expand All @@ -254,7 +254,7 @@ Orden de crecimiento de los algoritmos especificados en la notación O grande.

Fuente: [Big O Cheat Sheet](http:https://bigocheatsheet.com/).

A continuación se muestra la lista de algunas de las notaciones de Big O más utilizadas y sus comparaciones de rendimiento
A continuación se muestra la lista de algunas de las notaciones de Big O más utilizadas y sus comparaciones de rendimiento
frente a diferentes tamaños de los datos de entrada.

| Notación O grande | Cálculos para 10 elementos | Cálculos para 100 elementos | Cálculos para 1000 elementos |
Expand Down
30 changes: 15 additions & 15 deletions README.it-IT.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ un insieme di regole che definiscono con precisione una sequenza di operazioni.

* **Matematica**
* `P` [Manipolazione dei Bit](src/algorithms/math/bits) - set/get/update/clear bits, moltiplicazione/divisione per due, gestire numeri negativi etc.
* `P` [Fattoriale](src/algorithms/math/factorial)
* `P` [Fattoriale](src/algorithms/math/factorial)
* `P` [Numeri di Fibonacci](src/algorithms/math/fibonacci) - classico e forma chiusa
* `P` [Test di Primalità](src/algorithms/math/primality-test) (metodo del divisore)
* `P` [Algoritmo di Euclide](src/algorithms/math/euclidean-algorithm) - trova il massimo comune divisore (MCD)
* `P` [Minimo Comune Multiplo](src/algorithms/math/least-common-multiple) (MCM)
* `P` [Crivello di Eratostene](src/algorithms/math/sieve-of-eratosthenes) - trova i numeri i primi fino al limite indicato
* `P` [Potenza di due](src/algorithms/math/is-power-of-two) - controlla se il numero è una potenza di due
* `P` [Triangolo di Pascal](src/algorithms/math/pascal-triangle)
* `P` [Numeri Complessi](src/algorithms/math/complex-number) - numeri complessi e operazioni
* `P` [Numeri Complessi](src/algorithms/math/complex-number) - numeri complessi e operazioni
* `P` [Radiante & Gradi](src/algorithms/math/radian) - conversione da radiante a gradi e viceversa
* `P` [Potenza di un Numero](src/algorithms/math/fast-powering)
* `A` [Partizione di un Intero](src/algorithms/math/integer-partition)
* `A` [Radice Quadrata](src/algorithms/math/square-root) - Metodo di Newton
* `A` [Algoritmo di Liu Hui π](src/algorithms/math/liu-hui) - calcolare π usando un poligono
* `A` [Trasformata Discreta di Fourier ](src/algorithms/math/fourier-transform) -decomporre una funzione di tempo (un segnale) nelle frequenze che lo compongono
* `A` [Trasformata Discreta di Fourier ](src/algorithms/math/fourier-transform) -decomporre una funzione di tempo (un segnale) nelle frequenze che lo compongono
* **Set**
* `P` [Prodotto Cartesiano](src/algorithms/sets/cartesian-product) - moltiplicazione multipla di set
* `P` [Fisher–Yates Shuffle](src/algorithms/sets/fisher-yates) - permutazione casuale di un sequenza finita
Expand Down Expand Up @@ -116,8 +116,8 @@ un insieme di regole che definiscono con precisione una sequenza di operazioni.
* `P` [Ricerca in Profondità su Grafi](src/algorithms/graph/depth-first-search) (DFS)
* `P` [Breadth-First Search su Grafi](src/algorithms/graph/breadth-first-search) (BFS)
* `P` [Algoritmo di Kruskal](src/algorithms/graph/kruskal) - ricerca dell'Albero con Minima Distanza (MST) per grafi pesati unidirezionali
* `A` [Algoritmo di Dijkstra](src/algorithms/graph/dijkstra) - ricerca dei percorsi più breve per raggiungere tutti i vertici del grafo da un singolo vertice
* `A` [Algoritmo di Bellman-Ford](src/algorithms/graph/bellman-ford) - ricerca dei percorsi più breve per raggiungere tutti i vertici del grafo da un singolo vertice
* `A` [Algoritmo di Dijkstra](src/algorithms/graph/dijkstra) - ricerca dei percorsi più breve per raggiungere tutti i vertici del grafo da un singolo vertice
* `A` [Algoritmo di Bellman-Ford](src/algorithms/graph/bellman-ford) - ricerca dei percorsi più breve per raggiungere tutti i vertici del grafo da un singolo vertice
* `A` [Algoritmo di Floyd-Warshall](src/algorithms/graph/floyd-warshall) - ricerca dei percorsi più brevi tra tutte le coppie di vertici
* `A` [Rivelamento dei Cicli](src/algorithms/graph/detect-cycle) - per grafici diretti e non diretti (basate su partizioni DFS e Disjoint Set)
* `A` [Algoritmo di Prim](src/algorithms/graph/prim) - ricerca dell'Albero Ricoprente Minimo (MST) per grafi unidirezionali pesati
Expand All @@ -129,12 +129,12 @@ un insieme di regole che definiscono con precisione una sequenza di operazioni.
* `A` [Componenti Fortemente Connessa](src/algorithms/graph/strongly-connected-components) - algoritmo di Kosaraju
* `A` [Problema del Commesso Viaggiatore](src/algorithms/graph/travelling-salesman) - il percorso più breve che visita ogni città e ritorna alla città iniziale
* **Crittografia**
* `P` [Hash Polinomiale](src/algorithms/cryptography/polynomial-hash) - Una funzione hash di rolling basata sul polinomio
* `P` [Hash Polinomiale](src/algorithms/cryptography/polynomial-hash) - Una funzione hash di rolling basata sul polinomio
* **Senza categoria**
* `P` [Torre di Hanoi](src/algorithms/uncategorized/hanoi-tower)
* `P` [Rotazione Matrice Quadrata](src/algorithms/uncategorized/square-matrix-rotation) - algoritmo in memoria
* `P` [Jump Game](src/algorithms/uncategorized/jump-game) - backtracking, programmazione dinamica (top-down + bottom-up) ed esempre di greeedy
* `P` [Percorsi Unici](src/algorithms/uncategorized/unique-paths) - backtracking, programmazione dinamica and l'esempio del Triangolo di Pascal
* `P` [Percorsi Unici](src/algorithms/uncategorized/unique-paths) - backtracking, programmazione dinamica and l'esempio del Triangolo di Pascal
* `P` [Rain Terraces](src/algorithms/uncategorized/rain-terraces) - problema dell'acqua piovana in trappola(versione con programmazione dinamica e brute force)
* `P` [Recursive Staircase](src/algorithms/uncategorized/recursive-staircase) - contare il numero di percorsi per arrivare in vetta(4 soluzioni)
* `A` [Rompicapo delle Otto Regine](src/algorithms/uncategorized/n-queens)
Expand All @@ -151,14 +151,14 @@ un insieme di regole che definiscono con precisione una sequenza di operazioni.
* `P` [Recursive Staircase](src/algorithms/uncategorized/recursive-staircase) - contare il numero di percorsi per arrivare in vetta
* `A` [Massimo SubArray](src/algorithms/sets/maximum-subarray)
* `A` [Problema del commesso viaggiatore](src/algorithms/graph/travelling-salesman) - il percorso più breve che visita ogni città e ritorna alla città iniziale
* `A` [Trasformata Discreta di Fourier](src/algorithms/math/fourier-transform) - scomporre la funzione (segnale) del tempo in frequenze che la compongono
* `A` [Trasformata Discreta di Fourier](src/algorithms/math/fourier-transform) - scomporre la funzione (segnale) del tempo in frequenze che la compongono
* **Greedy** - scegliere l'opzione migliore al momento d'eleborazione dell'algoritmo, senza alcuna considerazione per il futuro
* `P` [Jump Game](src/algorithms/uncategorized/jump-game)
* `A` [Problema dello Zaino di Knapsack](src/algorithms/sets/knapsack-problem)
* `A` [Algoritmo di Dijkstra](src/algorithms/graph/dijkstra) - ricerca del percorso più breve tra tutti i vertici del grafo
* `A` [Algoritmo di Prim](src/algorithms/graph/prim) - ricerca del Minimo Albero Ricoprente per grafi pesati e unidirezionali
* `A` [Algoritmo di Prim](src/algorithms/graph/prim) - ricerca del Minimo Albero Ricoprente per grafi pesati e unidirezionali
* `A` [Kruskal’s Algorithm](src/algorithms/graph/kruskal) - finding Minimum Spanning Tree (MST) for weighted undirected graph
* **Divide e Conquista** - divide il problema in piccole parti e risolve ogni parte
* **Divide e Conquista** - divide il problema in piccole parti e risolve ogni parte
* `P` [Ricerca Binaria](src/algorithms/search/binary-search)
* `P` [Torre di Hanoi](src/algorithms/uncategorized/hanoi-tower)
* `P` [Triangolo di Pascal](src/algorithms/math/pascal-triangle)
Expand Down Expand Up @@ -186,7 +186,7 @@ un insieme di regole che definiscono con precisione una sequenza di operazioni.
* `A` [Partizione di un Intero](src/algorithms/math/integer-partition)
* `A` [Massimo SubArray](src/algorithms/sets/maximum-subarray)
* `A` [Algoritmo di Bellman-Ford](src/algorithms/graph/bellman-ford) - ricerca del percorso più breve per tutti i vertici del grafo
* `A` [Algoritmo di Floyd-Warshall](src/algorithms/graph/floyd-warshall) - ricerca del percorso più breve tra tutte le coppie di vertici
* `A` [Algoritmo di Floyd-Warshall](src/algorithms/graph/floyd-warshall) - ricerca del percorso più breve tra tutte le coppie di vertici
* `A` [Espressioni Regolari](src/algorithms/string/regular-expression-matching)
* **Backtracking** - come la brute force, provate a generare tutte le soluzioni possibili, ma ogni volta che generate la prossima soluzione testate se soddisfa tutte le condizioni e solo allora continuare a generare soluzioni successive. Altrimenti, fate marcia indietro, e andate su un percorso diverso per trovare una soluzione. Normalmente si utilizza l'algoritmo DFS.
* `P` [Jump Game](src/algorithms/uncategorized/jump-game)
Expand Down Expand Up @@ -228,10 +228,10 @@ npm test -- 'LinkedList'

**Playground**

Se vuoi puoi giocare le strutture dati e gli algoritmi nel file ./src/playground/playground.js` e
Se vuoi puoi giocare le strutture dati e gli algoritmi nel file ./src/playground/playground.js` e
scrivere test nel file `./src/playground/__test__/playground.test.js`.

Poi puoi semplicemente eseguire il seguente comando per testare quello che hai scritto :
Poi puoi semplicemente eseguire il seguente comando per testare quello che hai scritto :

```
npm test -- 'playground'
Expand All @@ -243,9 +243,9 @@ npm test -- 'playground'

[▶ Data Structures and Algorithms on YouTube](https://www.youtube.com/playlist?list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)

### Notazione Big O
### Notazione Big O

* La notazione Big O* è usata per classificare algoritmi in base al tempo di esecuzione o ai
* La notazione Big O* è usata per classificare algoritmi in base al tempo di esecuzione o ai
requisiti di spazio che crescono in base alla crescita dell'input .
Nella grafico qua sotto puoi trovare gli ordini di crescita più comuni degli algoritmi usando la notazione Big O.

Expand Down
4 changes: 2 additions & 2 deletions README.ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ _Read this in other languages:_

* **数学**
* `B` [ビット操作](src/algorithms/math/bits) - set/get/update/clear bits, 2つの乗算/除算, 否定的にする. 等
* `B` [因果関係](src/algorithms/math/factorial)
* `B` [因果関係](src/algorithms/math/factorial)
* `B` [フィボナッチ数](src/algorithms/math/fibonacci) - クラシックとクローズドフォームのバージョン
* `B` [素数性テスト](src/algorithms/math/primality-test) (trial division 方法)
* `B` [ユークリッドアルゴリズム](src/algorithms/math/euclidean-algorithm) - 最大公約数を計算する (GCD)
Expand Down Expand Up @@ -118,7 +118,7 @@ _Read this in other languages:_
* **グラフ**
* `B` [深度優先検索](src/algorithms/graph/depth-first-search) (DFS)
* `B` [幅優先検索](src/algorithms/graph/breadth-first-search) (BFS)
* `B` [Kruskalのアルゴリズム](src/algorithms/graph/kruskal) - 重み付き無向グラフの最小スパニングツリー(MST)の発見
* `B` [Kruskalのアルゴリズム](src/algorithms/graph/kruskal) - 重み付き無向グラフの最小スパニングツリー(MST)の発見
* `A` [Dijkstraアルゴリズム](src/algorithms/graph/dijkstra) - 単一の頂点からすべてのグラフ頂点への最短経路を見つける
* `A` [Bellman-Fordアルゴリズム](src/algorithms/graph/bellman-ford) - 単一の頂点からすべてのグラフ頂点への最短経路を見つける
* `A` [Floyd-Warshallアルゴリズム](src/algorithms/graph/floyd-warshall) - すべての頂点ペア間の最短経路を見つける
Expand Down
10 changes: 5 additions & 5 deletions README.ko-KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _Read this in other languages:_

자료 구조는 데이터를 특정 방식으로 구성하고 저장함으로써 더 효율적으로
접근하고 수정할 수 있게 해줍니다. 간단히 말해, 자료 구조는 데이터 값들,
데이터 간의 관계, 그리고 데이터를 다룰 수 있는 함수와 작업의 모임입니다.
데이터 간의 관계, 그리고 데이터를 다룰 수 있는 함수와 작업의 모임입니다.


`B` - 입문자, `A` - 숙련자
Expand All @@ -50,16 +50,16 @@ _Read this in other languages:_

## 알고리즘

알고리즘은 어떤 종류의 문제를 풀 수 있는 정확한 방법이며,
일련의 작업을 정확하게 정의해 놓은 규칙들입니다.
알고리즘은 어떤 종류의 문제를 풀 수 있는 정확한 방법이며,
일련의 작업을 정확하게 정의해 놓은 규칙들입니다.

`B` - 입문자, `A` - 숙련자

### 주제별 알고리즘

* **Math**
* `B` [Bit Manipulation](src/algorithms/math/bits) - set/get/update/clear bits, 2의 곱 / 나누기, 음수로 만들기 etc.
* `B` [팩토리얼](src/algorithms/math/factorial)
* `B` [팩토리얼](src/algorithms/math/factorial)
* `B` [피보나치 수](src/algorithms/math/fibonacci)
* `B` [소수 판별](src/algorithms/math/primality-test) (trial division 방식)
* `B` [유클리드 호제법](src/algorithms/math/euclidean-algorithm) - 최대공약수 (GCD)
Expand Down Expand Up @@ -126,7 +126,7 @@ _Read this in other languages:_
* **Uncategorized**
* `B` [하노이 탑](src/algorithms/uncategorized/hanoi-tower)
* `B` [정방 행렬 회전](src/algorithms/uncategorized/square-matrix-rotation) - 제자리(in-place) 알고리즘
* `B` [점프 게임](src/algorithms/uncategorized/jump-game) - 백트래킹, 동적계획법 (top-down + bottom-up), 탐욕 알고리즘 예제
* `B` [점프 게임](src/algorithms/uncategorized/jump-game) - 백트래킹, 동적계획법 (top-down + bottom-up), 탐욕 알고리즘 예제
* `B` [Unique 경로](src/algorithms/uncategorized/unique-paths) - 백트래킹, 동적계획법, 파스칼 삼각형에 기반한 예제
* `B` [빗물 담기 문제](src/algorithms/uncategorized/rain-terraces) - trapping rain water problem (동적계획법, 브루트포스 버전)
* `A` [N-Queens 문제](src/algorithms/uncategorized/n-queens)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ a set of rules that precisely define a sequence of operations.
* `B` [Bit Manipulation](src/algorithms/math/bits) - set/get/update/clear bits, multiplication/division by two, make negative etc.
* `B` [Factorial](src/algorithms/math/factorial)
* `B` [Fibonacci Number](src/algorithms/math/fibonacci) - classic and closed-form versions
* `B` [Prime Factors](src/algorithms/math/prime-factors) - finding prime factors and counting them using Hardy-Ramanujan's theorem
* `B` [Prime Factors](src/algorithms/math/prime-factors) - finding prime factors and counting them using Hardy-Ramanujan's theorem
* `B` [Primality Test](src/algorithms/math/primality-test) (trial division method)
* `B` [Euclidean Algorithm](src/algorithms/math/euclidean-algorithm) - calculate the Greatest Common Divisor (GCD)
* `B` [Least Common Multiple](src/algorithms/math/least-common-multiple) (LCM)
Expand Down Expand Up @@ -142,7 +142,7 @@ a set of rules that precisely define a sequence of operations.
* `B` [Polynomial Hash](src/algorithms/cryptography/polynomial-hash) - rolling hash function based on polynomial
* `B` [Caesar Cipher](src/algorithms/cryptography/caesar-cipher) - simple substitution cipher
* **Machine Learning**
* `B` [NanoNeuron](https://github.com/trekhleb/nano-neuron) - 7 simple JS functions that illustrate how machines can actually learn (forward/backward propagation)
* `B` [NanoNeuron](https://github.com/trekhleb/nano-neuron) - 7 simple JS functions that illustrate how machines can actually learn (forward/backward propagation)
* `B` [KNN](src/algorithms/ML/KNN) - K Nearest Neighbors
* **Uncategorized**
* `B` [Tower of Hanoi](src/algorithms/uncategorized/hanoi-tower)
Expand Down
Loading

0 comments on commit b13291d

Please sign in to comment.