chore(i18n,curriculum): update translations (#42969)

This commit is contained in:
camperbot
2021-07-22 21:31:38 +05:30
committed by GitHub
parent 24250d278e
commit c7fb462b4a
117 changed files with 590 additions and 577 deletions

View File

@ -1,6 +1,6 @@
---
id: a3f503de51cf954ede28891d
title: Find the Symmetric Difference
title: Trovare la differenza simmetrica
challengeType: 5
forumTopicId: 301611
dashedName: find-the-symmetric-difference
@ -8,77 +8,77 @@ dashedName: find-the-symmetric-difference
# --description--
The mathematical term <dfn>symmetric difference</dfn> (`△` or `⊕`) of two sets is the set of elements which are in either of the two sets but not in both. For example, for sets `A = {1, 2, 3}` and `B = {2, 3, 4}`, `A △ B = {1, 4}`.
Il termine matematico <dfn>differenza simmetrica</dfn> (`△` o `⊕`) di due insiemi è l'insieme di elementi che sono in uno dei due insiemi ma non in entrambi. Ad esempio, per gli insiemi `A = {1, 2, 3}` e `B = {2, 3, 4}`, `A △ B = {1, 4}`.
Symmetric difference is a binary operation, which means it operates on only two elements. So to evaluate an expression involving symmetric differences among *three* elements (`A △ B △ C`), you must complete one operation at a time. Thus, for sets `A` and `B` above, and `C = {2, 3}`, `A △ B △ C = (A △ B) △ C = {1, 4} △ {2, 3} = {1, 2, 3, 4}`.
La differenza simmetrica è un'operazione binaria, il che significa che opera solo su due elementi. Quindi per valutare un'espressione che comporta differenze simmetriche tra *tre* elementi (`A △ B △ C`), è necessario completare un'operazione alla volta. Così, per gli insiemi `A` e `B` di cui sopra, e `C = {2, 3}`, `A △ B △ C = (A △ B) △ C = {1, 4} △ {2, 3} = {1, 2, 3, 4}`.
# --instructions--
Create a function that takes two or more arrays and returns an array of their symmetric difference. The returned array must contain only unique values (*no duplicates*).
Crea una funzione che richiede due o più array e restituisce un array della loro differenza simmetrica. L'array restituito deve contenere solo valori univoci (*nessun duplicato*).
# --hints--
`sym([1, 2, 3], [5, 2, 1, 4])` should return `[3, 4, 5]`.
`sym([1, 2, 3], [5, 2, 1, 4])` dovrebbe restituire `[3, 4, 5]`.
```js
assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 4, 5]);
```
`sym([1, 2, 3], [5, 2, 1, 4])` should contain only three elements.
`sym([1, 2, 3], [5, 2, 1, 4])` dovrebbe contenere solo tre elementi.
```js
assert.equal(sym([1, 2, 3], [5, 2, 1, 4]).length, 3);
```
`sym([1, 2, 3, 3], [5, 2, 1, 4])` should return `[3, 4, 5]`.
`sym([1, 2, 3, 3], [5, 2, 1, 4])` dovrebbe restituire `[3, 4, 5]`.
```js
assert.sameMembers(sym([1, 2, 3, 3], [5, 2, 1, 4]), [3, 4, 5]);
```
`sym([1, 2, 3, 3], [5, 2, 1, 4])` should contain only three elements.
`sym([1, 2, 3, 3], [5, 2, 1, 4])` dovrebbe contenere solo tre elementi.
```js
assert.equal(sym([1, 2, 3, 3], [5, 2, 1, 4]).length, 3);
```
`sym([1, 2, 3], [5, 2, 1, 4, 5])` should return `[3, 4, 5]`.
`sym([1, 2, 3], [5, 2, 1, 4, 5])` dovrebbe restituire `[3, 4, 5]`.
```js
assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4, 5]), [3, 4, 5]);
```
`sym([1, 2, 3], [5, 2, 1, 4, 5])` should contain only three elements.
`sym([1, 2, 3], [5, 2, 1, 4, 5])` dovrebbe contenere solo tre elementi.
```js
assert.equal(sym([1, 2, 3], [5, 2, 1, 4, 5]).length, 3);
```
`sym([1, 2, 5], [2, 3, 5], [3, 4, 5])` should return `[1, 4, 5]`
`sym([1, 2, 5], [2, 3, 5], [3, 4, 5])` dovrebbe restituire `[1, 4, 5]`
```js
assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5]);
```
`sym([1, 2, 5], [2, 3, 5], [3, 4, 5])` should contain only three elements.
`sym([1, 2, 5], [2, 3, 5], [3, 4, 5])` dovrebbe contenere solo tre elementi.
```js
assert.equal(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]).length, 3);
```
`sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])` should return `[1, 4, 5]`.
`sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])` dovrebbe restituire `[1, 4, 5]`.
```js
assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5]);
```
`sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])` should contain only three elements.
`sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])` dovrebbe contenere solo tre elementi.
```js
assert.equal(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]).length, 3);
```
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3])` should return `[2, 3, 4, 6, 7]`.
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3])` dovrebbe restituire `[2, 3, 4, 6, 7]`.
```js
assert.sameMembers(
@ -87,7 +87,7 @@ assert.sameMembers(
);
```
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3])` should contain only five elements.
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3])` deve contenere solo cinque elementi.
```js
assert.equal(
@ -96,7 +96,7 @@ assert.equal(
);
```
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1])` should return `[1, 2, 4, 5, 6, 7, 8, 9]`.
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1])` dovrebbe restituire `[1, 2, 4, 5, 6, 7, 8, 9]`.
```js
assert.sameMembers(
@ -112,7 +112,7 @@ assert.sameMembers(
);
```
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1])` should contain only eight elements.
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1])` dovrebbe contenere solo otto elementi.
```js
assert.equal(

View File

@ -1,6 +1,6 @@
---
id: 587d825c367417b2b2512c8f
title: Implement Merge Sort
title: Implementare Merge Sort
challengeType: 1
forumTopicId: 301614
dashedName: implement-merge-sort
@ -8,27 +8,27 @@ dashedName: implement-merge-sort
# --description--
Another common intermediate sorting algorithm is merge sort. Like quick sort, merge sort also uses a divide-and-conquer, recursive methodology to sort an array. It takes advantage of the fact that it is relatively easy to sort two arrays as long as each is sorted in the first place. But we'll start with only one array as input, so how do we get to two sorted arrays from that? Well, we can recursively divide the original input in two until we reach the base case of an array with one item. A single-item array is naturally sorted, so then we can start combining. This combination will unwind the recursive calls that split the original array, eventually producing a final sorted array of all the elements. The steps of merge sort, then, are:
Un altro algoritmo di ordinamento intermedio comune è Merge Sort. Come Quick Sort, anche Merge Sort utilizza una metodologia ricorsiva divide-et-impera per ordinare un array. Esso si avvale del fatto che è relativamente semplice ordinare due array se ciascuno di essi è già ordinato. Ma inizieremo con un solo array come input, quindi come arriviamo a due array ordinati partendo da quello? Bene, possiamo dividere ricorsivamente a metà l'input originale fino a raggiungere il caso base di un array con un elemento. Un array con un singolo elemento è naturalmente ordinato, quindi possiamo iniziare a combinare. Questa combinazione darà il via alle chiamate ricorsive che dividono l'array originale, producendo alla fine un array finale ordinato di tutti gli elementi. I passi di Merge Sort, sono quindi:
**1)** Recursively split the input array in half until a sub-array with only one element is produced.
**1)** Dividi ricorsivamente l'array di input a metà finché non viene prodotto un sotto-array con un solo elemento.
**2)** Merge each sorted sub-array together to produce the final sorted array.
**2)** Unisci tutti i sottoarray ordinati per produrre l'array finale ordinato.
Merge sort is an efficient sorting method, with time complexity of *O(nlog(n))*. This algorithm is popular because it is performant and relatively easy to implement.
Il Merge Sort è un metodo di ordinamento efficiente, con complessità temporale di *O(nlog(n))*. Questo algoritmo è popolare perché è performante e relativamente facile da implementare.
As an aside, this will be the last sorting algorithm we cover here. However, later in the section on tree data structures we will describe heap sort, another efficient sorting method that requires a binary heap in its implementation.
A parte questo, questo sarà l'ultimo algoritmo di ordinamento che tratteremo qui. Tuttavia, più tardi nella sezione sulle strutture di dati ad albero descriveremo Heap Sort, un altro metodo di ordinamento efficiente che richiede un heap binario nella sua implementazione.
**Instructions:** Write a function `mergeSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest. A good way to implement this is to write one function, for instance `merge`, which is responsible for merging two sorted arrays, and another function, for instance `mergeSort`, which is responsible for the recursion that produces single-item arrays to feed into merge. Good luck!
**Istruzioni:** Scrivi una funzione `mergeSort` che prende un array di interi come input e restituisce un array di questi interi in ordine dal più piccolo al più grande. Un buon modo per implementarlo è quello di scrivere una funzione, per esempio `merge`, che si occupa dell'unione di due array, e un'altra funzione, per esempio `mergeSort`, che è responsabile della ricorsione e che produce array di elementi singoli da fornire a Merge. Buona fortuna!
# --hints--
`mergeSort` should be a function.
`mergeSort` dovrebbe essere una funzione.
```js
assert(typeof mergeSort == 'function');
```
`mergeSort` should return a sorted array (least to greatest).
`mergeSort` dovrebbe restituire un array ordinato (dal più piccolo al più grande).
```js
assert(
@ -56,7 +56,7 @@ assert(
);
```
`mergeSort` should return an array that is unchanged except for order.
`mergeSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])` dovrebbe restituire un array invariato tranne che per l'ordine.
```js
assert.sameMembers(
@ -83,7 +83,7 @@ assert.sameMembers(
);
```
`mergeSort` should not use the built-in `.sort()` method.
`mergeSort` non dovrebbe utilizzare il metodo integrato `.sort()`.
```js
assert(isBuiltInSortUsed());
@ -117,8 +117,6 @@ function mergeSort(array) {
return array;
// Only change code above this line
}
mergeSort([1, 4, 2, 8, 345, 123, 43, 32, 5643, 63, 123, 43, 2, 55, 1, 234, 92]);
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 587d8259367417b2b2512c85
title: Implement Selection Sort
title: Implementare Selection Sort
challengeType: 1
forumTopicId: 301616
dashedName: implement-selection-sort
@ -8,19 +8,19 @@ dashedName: implement-selection-sort
# --description--
Here we will implement selection sort. Selection sort works by selecting the minimum value in a list and swapping it with the first value in the list. It then starts at the second position, selects the smallest value in the remaining list, and swaps it with the second element. It continues iterating through the list and swapping elements until it reaches the end of the list. Now the list is sorted. Selection sort has quadratic time complexity in all cases.
Qui implementeremo Selection Sort. Selection Sort funziona selezionando il valore minimo in una lista e scambiandolo con il primo valore dell'elenco. Poi inizia dalla seconda posizione, seleziona il valore più piccolo nella lista rimanente e lo scambia con il secondo elemento. Continua a iterare attraverso la lista e scambiare gli elementi fino a raggiungere la fine della lista. Ora la lista è ordinata. Il selection sort ha una complessità di tempo quadratica in tutti i casi.
**Instructions**: Write a function `selectionSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest.
**Istruzioni:** Scrivi una funzione `selectionSort` che prende un array di interi come input e restituisce un array di questi interi in ordine dal più piccolo al più grande.
# --hints--
`selectionSort` should be a function.
`selectionSort` dovrebbe essere una funzione.
```js
assert(typeof selectionSort == 'function');
```
`selectionSort` should return a sorted array (least to greatest).
`selectionSort` dovrebbe restituire un array ordinato (dal più piccolo al più grande).
```js
assert(
@ -48,7 +48,7 @@ assert(
);
```
`selectionSort` should return an array that is unchanged except for order.
`selectionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])` dovrebbe restituire un array invariato tranne che per l'ordine.
```js
assert.sameMembers(
@ -75,7 +75,7 @@ assert.sameMembers(
);
```
`selectionSort` should not use the built-in `.sort()` method.
`selectionSort` non dovrebbe usare il metodo integrato `.sort()`.
```js
assert(isBuiltInSortUsed());
@ -109,9 +109,6 @@ function selectionSort(array) {
return array;
// Only change code above this line
}
selectionSort([1, 4, 2, 8, 345, 123, 43, 32, 5643, 63, 123, 43, 2, 55, 1, 234, 92]);
```
# --solutions--