This commit is contained in:
La Programmatrice Verde
2026-03-24 08:40:12 +01:00
parent 862a32aa39
commit f35818db88

View File

@@ -1,15 +1,19 @@
package linkedlist; package linkedlist;
public class Lista { public class Lista<E> {
Nodo testa; Nodo<E> testa;
int size; int size;
public Lista() { public Lista() {
this.testa = null; this.testa = null;
} }
//getSize(): restituisce il numero dei nodi presenti nella lista (quindi valore di ritorno è di tipo int) public int getSize() {
return this.size;
}
//addFirst(tipoInfo info): aggiunge un nodo in testa (es. tipoInfo = char, tipoInfo = int) //addFirst(tipoInfo info): aggiunge un nodo in testa (es. tipoInfo = char, tipoInfo = int)
//addLast(tipoInfo info): aggiunge un nodo in coda (es. tipoInfo = char, tipoInfo = int) //addLast(tipoInfo info): aggiunge un nodo in coda (es. tipoInfo = char, tipoInfo = int)
//addElementAt(tipoInfo info, int pos): aggiunge un nodo nella posizione indicata da pos //addElementAt(tipoInfo info, int pos): aggiunge un nodo nella posizione indicata da pos