getSize
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user