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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
id: 587d78b1367417b2b2512b09
title: 使圖片自適應設備尺寸
challengeType: 0
videoUrl: 'https://scrimba.com/p/pzrPu4/cz763UD'
forumTopicId: 301140
dashedName: make-an-image-responsive
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
id: 587d78b1367417b2b2512b09
title: 使图片自适应设备尺寸
challengeType: 0
videoUrl: 'https://scrimba.com/p/pzrPu4/cz763UD'
forumTopicId: 301140
dashedName: make-an-image-responsive
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
id: 587d78b1367417b2b2512b09
title: Haz una imagen responsiva
challengeType: 0
videoUrl: 'https://scrimba.com/p/pzrPu4/cz763UD'
forumTopicId: 301140
dashedName: make-an-image-responsive
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
id: 587d78b1367417b2b2512b09
title: Rendere un'immagine responsiva
challengeType: 0
videoUrl: 'https://scrimba.com/p/pzrPu4/cz763UD'
forumTopicId: 301140
dashedName: make-an-image-responsive
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
---
id: 587d8259367417b2b2512c86
title: Implement Insertion Sort
title: Implementare Insertion Sort
challengeType: 1
forumTopicId: 301613
dashedName: implement-insertion-sort
---

# --description--

The next sorting method we'll look at is insertion sort. This method works by building up a sorted array at the beginning of the list. It begins the sorted array with the first element. Then it inspects the next element and swaps it backwards into the sorted array until it is in sorted position. It continues iterating through the list and swapping new items backwards into the sorted portion until it reaches the end. This algorithm has quadratic time complexity in the average and worst cases.
Il prossimo metodo di ordinamento che vedremo è Insertion Sort. Questo metodo funziona costruendo un array ordinato all'inizio della lista. Esso inizia l'array ordinato con il primo elemento. Poi ispeziona l'elemento successivo e lo scambia all'indietro nell'array ordinato fino a quando non è in posizione ordinata. Continua a iterare attraverso la lista e a scambiare nuovi elementi all'indietro nella porzione ordinata fino a raggiungere la fine. Questo algoritmo ha una complessità di tempo quadratica nei casi medi e peggiori.

**Instructions:** Write a function `insertionSort` 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 `insertionSort` che prende un array di interi come input e restituisce un array di questi interi in ordine dal più piccolo al più grande.

# --hints--

`insertionSort` should be a function.
`insertionSort` dovrebbe essere una funzione.

```js
assert(typeof insertionSort == 'function');
```

`insertionSort` should return a sorted array (least to greatest).
`insertionSort` dovrebbe restituire un array ordinato (dal più piccolo al più grande).

```js
assert(
Expand Down Expand Up @@ -48,7 +48,7 @@ assert(
);
```

`insertionSort` should return an array that is unchanged except for order.
`insertionSort([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(
Expand All @@ -75,7 +75,7 @@ assert.sameMembers(
);
```

`insertionSort` should not use the built-in `.sort()` method.
`insertionSort` non deve usare il metodo integrato `.sort()`.

```js
assert(isBuiltInSortUsed());
Expand Down Expand Up @@ -109,8 +109,6 @@ function insertionSort(array) {
return array;
// Only change code above this line
}

insertionSort([1, 4, 2, 8, 345, 123, 43, 32, 5643, 63, 123, 43, 2, 55, 1, 234, 92]);
```

# --solutions--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
---
id: 587d825a367417b2b2512c89
title: Implement Quick Sort
title: Implementare Quick Sort
challengeType: 1
forumTopicId: 301615
dashedName: implement-quick-sort
---

# --description--

Here we will move on to an intermediate sorting algorithm: quick sort. Quick sort is an efficient, recursive divide-and-conquer approach to sorting an array. In this method, a pivot value is chosen in the original array. The array is then partitioned into two subarrays of values less than and greater than the pivot value. We then combine the result of recursively calling the quick sort algorithm on both sub-arrays. This continues until the base case of an empty or single-item array is reached, which we return. The unwinding of the recursive calls return us the sorted array.
Qui passeremo ad un algoritmo di ordinamento intermedio: Quick Sort. Quick Sort è un approccio efficiente e ricorsivo di logica divide-et-impera per l'ordinamento di un array. In questo approccio, viene scelto un valore pivot nell'array originale. L'array viene poi suddiviso in due sottoarray di valori inferiori e superiori al valore pivot. Quindi combiniamo il risultato della chiamata ricorsiva dell'algoritmo Quick Sort su entrambi i sotto-array. Questo continua fino al raggiungimento del caso base di un array vuoto o di un singolo oggetto, al che torniamo indietro. Lo svolgimento delle chiamate ricorsive restitusce l'array ordinato.

Quick sort is a very efficient sorting method, providing *O(nlog(n))* performance on average. It is also relatively easy to implement. These attributes make it a popular and useful sorting method.
Quick Sort è un metodo di ordinamento molto efficiente, che fornisce prestazioni *O(nlog(n))* in media. È anche relativamente facile da implementare. Questi attributi lo rendono un metodo di ordinamento popolare e utile.

**Instructions:** Write a function `quickSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest. While the choice of the pivot value is important, any pivot will do for our purposes here. For simplicity, the first or last element could be used.
**Istruzioni:** Scrivi una funzione `quickSort` che prende un array di interi come input e restituisce un array di questi interi in ordine dal più piccolo al più grande. Anche se la scelta del valore pivot è importante, per i nostri scopi andrà bene qualsiasi pivot. Per semplicità, si potrebbe usare il primo o l'ultimo elemento.

# --hints--

`quickSort` should be a function.
`quickSort` dovrebbe essere una funzione.

```js
assert(typeof quickSort == 'function');
```

`quickSort` should return a sorted array (least to greatest).
`quickSort` dovrebbe restituire un array ordinato (dal più piccolo al più grande).

```js
assert(
Expand Down Expand Up @@ -50,7 +50,7 @@ assert(
);
```

`quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])` should return an array that is unchanged except for order.
`quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])` dovrebbe restituire un array che è invariato tranne che per l'ordine.

```js
assert.sameMembers(
Expand All @@ -77,7 +77,7 @@ assert.sameMembers(
);
```

`quickSort` should not use the built-in `.sort()` method.
`quickSort` non dovrebbe utilizzare il metodo integrato `.sort()`.

```js
assert(isBuiltInSortUsed());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
id: a56138aff60341a09ed6c480
title: Inventory Update
title: Aggiornamento dell'inventario
challengeType: 5
forumTopicId: 16019
dashedName: inventory-update
---

# --description--

Compare and update the inventory stored in a 2D array against a second 2D array of a fresh delivery. Update the current existing inventory item quantities (in `arr1`). If an item cannot be found, add the new item and quantity into the inventory array. The returned inventory array should be in alphabetical order by item.
Confronta e aggiorna l'inventario memorizzato in un array 2D rispetto ad un secondo array 2D che rappresenta una nuova consegna. Aggiorna le quantità attuali degli oggetti esistenti (in `arr1`). Se un oggetto non viene trovato, aggiungi il nuovo oggetto e la sua quantità nell'array dell'inventario. L'array di inventario restituito dovrebbe essere in ordine alfabetico per articolo.

# --hints--

The function `updateInventory` should return an array.
La funzione `updateInventory` deve restituire un array.

```js
assert.isArray(
Expand All @@ -33,7 +33,7 @@ assert.isArray(
);
```

`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` should return an array with a length of 6.
`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` dovrebbe restituire un array di lunghezza di 6.

```js
assert.equal(
Expand All @@ -55,7 +55,7 @@ assert.equal(
);
```

`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` should return `[[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]]`.
`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` dovrebbe restituire `[[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]]`.

```js
assert.deepEqual(
Expand Down Expand Up @@ -84,7 +84,7 @@ assert.deepEqual(
);
```

`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [])` should return `[[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]]`.
`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [])` dovrebbe restituire `[[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]]`.

```js
assert.deepEqual(
Expand All @@ -106,7 +106,7 @@ assert.deepEqual(
);
```

`updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` should return `[[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]]`.
`updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` dovrebbe restituire `[[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]]`.

```js
assert.deepEqual(
Expand All @@ -128,7 +128,7 @@ assert.deepEqual(
);
```

`updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]])` should return `[[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]]`.
`updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]])` dovrebbe restituire `[[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]]`.

```js
assert.deepEqual(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d7789367417b2b2512aa4
title: Melhore a acessibilidade de áudios com o elemento audio
title: Melhorar a acessibilidade de áudios com o elemento audio
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJVkcZ'
forumTopicId: 301014
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d778a367417b2b2512aa5
title: Melhore a acessibilidade de gráficos com o elemento figure
title: Melhorar a acessibilidade de gráficos com o elemento figure
challengeType: 0
videoUrl: 'https://scrimba.com/c/cGJMqtE'
forumTopicId: 301015
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d778e367417b2b2512aab
title: Melhore a legibilidade com textos de alto contraste
title: Melhorar a legibilidade com textos de alto contraste
challengeType: 0
videoUrl: 'https://scrimba.com/c/cKb3nCq'
forumTopicId: 301017
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d7787367417b2b2512aa1
title: Facilite a navegação do leitor de tela com o ponto de referência header
title: Facilitar a navegação do leitor de tela com o ponto de referência header
challengeType: 0
videoUrl: 'https://scrimba.com/c/cB76vtv'
forumTopicId: 301023
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d7788367417b2b2512aa2
title: Facilite a navegação do leitor de tela com o ponto de referência nav
title: Facilitar a navegação do leitor de tela com o ponto de referência nav
challengeType: 0
videoUrl: 'https://scrimba.com/c/czVwWSv'
forumTopicId: 301024
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d778c367417b2b2512aa9
title: Padronize o tempo com o atributo datetime no HTML5
title: Padronizar o tempo com o atributo datetime no HTML5
challengeType: 0
videoUrl: 'https://scrimba.com/c/cmzMgtz'
forumTopicId: 301025
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d7790367417b2b2512ab0
title: Use tabindex para adicionar foco a um elemento usando o teclado
title: Usar tabindex para adicionar foco a um elemento usando o teclado
challengeType: 0
videoUrl: 'https://scrimba.com/c/cmzMDHW'
forumTopicId: 301027
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d774e367417b2b2512aa0
title: Envolva conteúdos usando o elemento article
title: Envolver conteúdos usando o elemento article
challengeType: 0
videoUrl: 'https://scrimba.com/c/cPp79S3'
forumTopicId: 301029
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d778b367417b2b2512aa7
title: Envolva botões de opção em um elemento fieldset para melhor acessibilidade
title: Envolver botões de opção em um elemento fieldset para melhor acessibilidade
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJVefw'
forumTopicId: 301030
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a3367417b2b2512ad1
title: Cores complementares
title: Aprender sobre cores complementares
challengeType: 0
videoUrl: 'https://scrimba.com/c/c2MD3Tr'
forumTopicId: 301056
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a4367417b2b2512ad2
title: Cores terciárias
title: Aprender sobre cores terciárias
challengeType: 0
forumTopicId: 301057
dashedName: learn-about-tertiary-colors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a9367417b2b2512ae8
title: Aprenda como as curvas de Bézier funcionam
title: Aprender como as curvas de Bézier funcionam
challengeType: 0
videoUrl: 'https://scrimba.com/c/c9bDrs8'
forumTopicId: 301058
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a7367417b2b2512adf
title: Aprenda como funcionam as propriedades de animação e @keyframes do CSS
title: Aprender como funcionam as propriedades de animação e @keyframes do CSS
challengeType: 0
videoUrl: 'https://scrimba.com/c/cakprhv'
forumTopicId: 301059
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d781e367417b2b2512aca
title: Mova um elemento posicionado relativamente com as propriedades de deslocamentos CSS
title: Mover um elemento posicionado relativamente com as propriedades de deslocamentos CSS
challengeType: 0
videoUrl: 'https://scrimba.com/c/c9bQEA4'
forumTopicId: 301065
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a3367417b2b2512ace
title: Empurre os elementos para a esquerda ou direita com a propriedade float
title: Empurrar os elementos para a esquerda ou direita com a propriedade float
challengeType: 0
videoUrl: 'https://scrimba.com/c/c2MDqu2'
forumTopicId: 301066
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d781c367417b2b2512ac3
title: Defina a espessura da tipografia para vários elementos de cabeçalho
title: Definir a espessura da tipografia para vários elementos de cabeçalho
challengeType: 0
videoUrl: 'https://scrimba.com/c/crVWRHq'
forumTopicId: 301069
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a9367417b2b2512ae9
title: Use uma curva de Bézier para mover um elemento
title: Usar uma curva de Bézier para mover um elemento
challengeType: 0
videoUrl: 'https://scrimba.com/c/c6bnRCK'
forumTopicId: 301071
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a5367417b2b2512ad7
title: Use um gradiente linear com CSS para criar um elemento listrado
title: Usar um gradiente linear com CSS para criar um elemento listrado
challengeType: 0
videoUrl: 'https://scrimba.com/c/c6bmQh2'
forumTopicId: 301072
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a7367417b2b2512ae0
title: Use animações CSS para alterar o estado de foco de um botão
title: Usar animações CSS para alterar o estado de foco de um botão
challengeType: 0
videoUrl: 'https://scrimba.com/c/cg4vZAa'
forumTopicId: 301073
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a6367417b2b2512adb
title: Use a propriedade skewX de transformação do CSS para distorcer um elemento ao longo do eixo X
title: Usar a propriedade skewX de transformação do CSS para distorcer um elemento ao longo do eixo X
challengeType: 0
videoUrl: 'https://scrimba.com/c/cyLP8Sr'
forumTopicId: 301074
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a6367417b2b2512adc
title: Use a propriedade skewY de transformação do CSS para distorcer um elemento ao longo do eixo Y
title: Usar a propriedade skewY de transformação do CSS para distorcer um elemento ao longo do eixo Y
challengeType: 0
videoUrl: 'https://scrimba.com/c/c2MZ2uB'
forumTopicId: 301075
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a5367417b2b2512ad9
title: Use a propriedade scale de transformação do CSS para alterar o tamanho de um elemento
title: Usar a propriedade scale de transformação do CSS para alterar o tamanho de um elemento
challengeType: 0
videoUrl: 'https://scrimba.com/c/c2MZVSg'
forumTopicId: 301076
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: 587d78a5367417b2b2512ada
title: Use a propriedade scale de transformação do CSS para dimensionar um elemento ao passar o cursor do mouse sobre ele
title: Usar a propriedade scale de transformação do CSS para dimensionar um elemento ao passar o cursor do mouse sobre ele
challengeType: 0
videoUrl: 'https://scrimba.com/c/cyLPJuM'
forumTopicId: 301077
Expand Down
Loading