This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add(punto) | |
if (mi nivel es par) | |
if (el x del punto a agregar es < que mi propio x) | |
this.hijoIzquierdo() == null ? this.agregarHijoIzquierdo(punto) : this.hijoIzquierdo().add(punto) | |
else | |
this.hijoDerecho() == null ? this.agregarHijoDerecho(punto) : this.hijoIzquierdo().add(punto) | |
if (mi nivel es impar) | |
if (el y del punto a agregar es < que mi propio y) | |
this.hijoIzquierdo() == null ? this.agregarHijoIzquierdo(punto) : this.hijoIzquierdo().add(punto) | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tp04.ejercicio1; | |
import static org.junit.Assert.*; | |
import org.junit.Before; | |
import org.junit.Test; | |
public class ArbolBinarioTest { | |
private ArbolBinario<Integer> arbolBinarioTest; |
NewerOlder