update
This commit is contained in:
parent
f94534032a
commit
c9106da1e6
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -16,6 +16,10 @@ public class ArvoreArvore {
|
||||||
//os outros 23 caracteres.
|
//os outros 23 caracteres.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void inserir(char letra){
|
||||||
|
//igual ao da árvore binária padrão!!!
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void inserir(String s){
|
public void inserir(String s){
|
||||||
inserir(s, raiz);
|
inserir(s, raiz);
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ public class Agenda {
|
||||||
|
|
||||||
public Agenda() {
|
public Agenda() {
|
||||||
raiz = new No ('M');
|
raiz = new No ('M');
|
||||||
raiz.esq = new No ('F');
|
raiz.esq = new No ('G');
|
||||||
raiz.dir = new No ('T');
|
raiz.dir = new No ('T');
|
||||||
raiz.esq.esq = new No ('C');
|
raiz.esq.esq = new No ('A');
|
||||||
//inserir todas as 26 letras do alfabeto...
|
//inserir todas as 26 letras do alfabeto...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46,7 +46,6 @@ public class Agenda {
|
||||||
// insere o nó com a letra
|
// insere o nó com a letra
|
||||||
if (no == null) {
|
if (no == null) {
|
||||||
no = new no(Character.toUpperCase(contato.nome.charAt(0)));
|
no = new no(Character.toUpperCase(contato.nome.charAt(0)));
|
||||||
no.primeiro = no.ultimo = new Celula();
|
|
||||||
no.ultimo.prox = new Celula(contato);
|
no.ultimo.prox = new Celula(contato);
|
||||||
no.ultimo = no.ultimo.prox;
|
no.ultimo = no.ultimo.prox;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,14 @@ class Contato {
|
||||||
public String telefone;
|
public String telefone;
|
||||||
public String email;
|
public String email;
|
||||||
public int cpf;
|
public int cpf;
|
||||||
|
|
||||||
|
public Contato(){
|
||||||
|
this("","","",-1);
|
||||||
|
}
|
||||||
|
public Contato(String nome, String telefone, String email, int cpf){
|
||||||
|
this.nome = nome;
|
||||||
|
this.telefone = telefone;
|
||||||
|
this.email = email;
|
||||||
|
this.cpf = cpf;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ class No {
|
||||||
public No esq, dir;
|
public No esq, dir;
|
||||||
public Celula primeiro, ultimo;
|
public Celula primeiro, ultimo;
|
||||||
|
|
||||||
No(char letra) {
|
public No(char letra) {
|
||||||
this.letra = letra;
|
this.letra = letra;
|
||||||
this.esq = this.dir = null;
|
this.esq = this.dir = null;
|
||||||
primeiro = ultimo = new Celula();
|
primeiro = ultimo = new Celula();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue