@@ -0,0 +1,941 @@
+package te_comp_19;%0Aclass Persona implements Comparable%3CPersona%3E%7B%0A%09String nome;%0A%09public Persona(String string) %7B%0A%09%09nome = string;%0A%09%7D%0A%09@Override%0A%09public int compareTo(Persona o) %7B%0A%09%09return nome.compareTo(o.nome);%0A%09%7D%0A%7D%0A%0Aclass AlberoPersone%7B%0A%09NodoAlbero root;%0A%09class NodoAlbero%7B%0A%09%09Persona dato;%0A%09%09AlberoPersone sx, dx;%0A%09%7D%0A%09%0A%09public AlberoPersone() %7B%0A%09%09root = null;%0A%09%7D%0A%09%0A%09void insert(Persona p) %7B%0A%09%09if (root == null) %7B%0A%09%09%09root = new NodoAlbero();%0A%09%09%09root.dato = p;%0A%09%09%09root.sx = new AlberoPersone();%0A%09%09%09root.dx = new AlberoPersone();%0A%09%09%7D else %7B%0A%09%09%09if (root.dato.compareTo(p) %3C0) %7B%0A%09%09%09%09root.dx.insert(p);%0A%09%09%09%7D else %7B%0A%09%09%09%09root.sx.insert(p);%0A%09%09%09%7D%0A%09%09%7D%0A%09%0A%09%7D%0A%09void print()%7B%0A%09%09%0A%09%7D%0A%09%0A%7D%0A%0Apublic class GargantiniAngelo %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09AlberoPersone ap = new AlberoPersone();%0A%09%09ap.insert(new Persona(%22pippo%22));%0A%09%09ap.insert(new Persona(%22annah%22));%0A%09%09ap.insert(new Persona(%22balli%22));%0A%09%09ap.insert(new Persona(%22manni%22));%0A%09%09%0A%09%7D%0A%09%0A%7D%0A

insert in albero persona