Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int getAltura() {
- if (this.filhoEsquerdo == null && this.filhoDireito == null)
- return 0;
- else {
- if (this.filhoDireito != null && filhoEsquerdo != null){
- if (this.filhoEsquerdo.getAltura() > this.filhoDireito.getAltura())
- return this.filhoEsquerdo.getAltura() + 1;
- else
- return this.filhoDireito.getAltura() + 1;
- } else if (this.filhoDireito == null)
- return this.filhoEsquerdo.getAltura() + 1;
- else if (this.filhoEsquerdo == null)
- return this.filhoDireito.getAltura() + 1;
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement