-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathABB.h
46 lines (41 loc) · 1.05 KB
/
ABB.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef ABB_H
#define ABB_H
#include <iostream>
#include <string>
using namespace std;
class NohArvore {
friend class ABB;
public:
NohArvore (string d, int pos);
NohArvore (string d);
protected:
string valor;
int pos;
NohArvore* esq;
NohArvore* dir;
NohArvore* pai;
};
class ABB {
public:
ABB() { raiz = NULL; }
~ABB();
// Insere um dado na árvore.
void Inserir(string d, int pos);
// Verifica se um dado tem sucessor e o retorna.
void EmOrdem();
void EOAux( NohArvore* aux);
void PreOrdem();
void POAux( NohArvore* aux);
void Remover (string d);
int Nivel(string d);
void Transplanta( NohArvore* antigo, NohArvore* novo);
int Busca(string valor);
void arrumaPosicao(string valor, int pos);
NohArvore* BuscaAux(NohArvore* aux);
NohArvore* MinAux(NohArvore* aux);
void PosOrdem();
void OOAux( NohArvore* aux);
protected:
NohArvore* raiz;
};
#endif