Esercizio 1: public class L { private int h; private L t; public L(int h, L t) { this.h = h; this.t = t; } public L rev() { L ris = new L(h,null); for (L temp = t; temp != null; temp = temp.t) ris = new L(temp.h,ris); return ris; } } Esercizio 2: public static int poly(int[] p, int x) { return poly(p,x,0); } private static int poly(int[] p, int x, int pos) { if (pos == p.length) return 0; else return p[pos] + x * poly(p,x,pos + 1); } Esercizio 3: public class ElencoLast extends Elenco { private String last; public ElencoLast(int dim) { super(dim); } protected int getPos(String tizio) { // tieniamo traccia dell'ultima voce inserita // o ricercata nell'elenco last = tizio; return super.getPos(tizio); } public int getLast() { return getTelefono(last); } }