Updated README-it.md

[Data Structures -> Arrays] Done
This commit is contained in:
Marco Marrelli
2022-05-16 11:24:58 +02:00
committed by GitHub
parent 64f3e82ace
commit d634ee7e35

View File

@ -619,30 +619,30 @@ per testare la tua capacità nell'identificare la complessità del runtime di di
- [Arrays Dinamici (Video in Inglese)](https://www.coursera.org/lecture/data-structures/dynamic-arrays-EwbnV) - [Arrays Dinamici (Video in Inglese)](https://www.coursera.org/lecture/data-structures/dynamic-arrays-EwbnV)
- [Matrici Irregolari o Jagged Arrays (Video in Inglese)](https://www.youtube.com/watch?v=1jtrQqYpt7g) - [Matrici Irregolari o Jagged Arrays (Video in Inglese)](https://www.youtube.com/watch?v=1jtrQqYpt7g)
- [ ] Implementare un vettore (array mutabile con grandezza automatica): - [ ] Implementare un vettore (array mutabile con grandezza automatica):
- [ ] Practice coding using arrays and pointers, and pointer math to jump to an index instead of using indexing. - [ ] Programma usando arrays, puntatori e l'aritmetica dei puntatori per raggiungere un index, piuttosto che usare l'indexing.
- [ ] New raw data array with allocated memory - [ ] Array con dati non raffinati (raw) e memoria allocata
- can allocate int array under the hood, just not use its features - puoi allocare array di interi, ma non usare le sue features
- start with 16, or if starting number is greater, use power of 2 - 16, 32, 64, 128 - comincia con 16, o se il numero iniziale è maggiore, usa delle potenze del 2 - 16, 32, 64, 128
- [ ] size() - number of items - [ ] size() - numero degli elementi
- [ ] capacity() - number of items it can hold - [ ] capacity() - numero degli elementi che può contenere in totale
- [ ] is_empty() - [ ] is_empty() - se l'array è vuoto
- [ ] at(index) - returns item at given index, blows up if index out of bounds - [ ] at(index) - fa il return di un item all'index dato, esplode se l'index è out of bounds (letteralmente, "fuori dai limiti")
- [ ] push(item) - [ ] push(item) - inserisce (pusha) un item alla fine di un array
- [ ] insert(index, item) - inserts item at index, shifts that index's value and trailing elements to the right - [ ] insert(index, item) - inserisce un item all'index dato, spostando gli altri item verso destra (verso la fine)
- [ ] prepend(item) - can use insert above at index 0 - [ ] prepend(item) - come usare insert() con index 0
- [ ] pop() - remove from end, return value - [ ] pop() - rimuove l'elemento alla fine e lo returna
- [ ] delete(index) - delete item at index, shifting all trailing elements left - [ ] delete(index) - elimina l'item all'index dato, spostando gli altri item verso sinistra (verso l'inizio)
- [ ] remove(item) - looks for value and removes index holding it (even if in multiple places) - [ ] remove(item) - cerca il valore dato e rimuove il suo index (funziona anche se si trova in più caselle)
- [ ] find(item) - looks for value and returns first index with that value, -1 if not found - [ ] find(item) - cerca un valore e returna il primo index contenente quell'item, returna -1 se non viene trovato
- [ ] resize(new_capacity) // private function - [ ] resize(new_capacity) // funzione private
- when you reach capacity, resize to double the size - quando raggiungi la capacità massima, la raddoppia
- when popping an item, if size is 1/4 of capacity, resize to half - quando viene fatto il pop() di un item, se la grandezza è 1/4 della capacità, allora la reduce di metà
- [ ] Time - [ ] Tempo
- O(1) to add/remove at end (amortized for allocations for more space), index, or update - O(1) per aggiungere/rimuovere alla fine (amortized for allocations for more space), indexare o aggiornare
- O(n) to insert/remove elsewhere - O(n) per aggiungere/rimuovere in qualsiasi punto
- [ ] Space - [ ] Spazio
- contiguous in memory, so proximity helps performance - contiguo in memoria, quindi la vicinanza aiuta a migliorare la performance
- space needed = (array capacity, which is >= n) * size of item, but even if 2n, still O(n) - spazio necessario = (capacità dell'array, che è >= n) * grandezza di un item, ma anche se 2n, rimane O(n)
- ### Linked Lists - ### Linked Lists
- [ ] Description: - [ ] Description: