Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Eliminazione
- public void Elimina(Foglia f, Foglia f1) {
- if (f1 == null) {
- System.out.println("Elemento non presente");
- return;
- } else {
- if (f.info.equals(f1.info) == true) {
- f.Fired = true;
- return;
- }
- else if (f.info.compareTo(f1.info) > 0) {
- f1 = f1.getDx();
- Elimina(f, f1);
- }
- else if (f.info.compareTo(f1.info) < 0) {
- f1 = f1.getSx();
- Elimina(f, f1);
- }
- }
- }
- public void Delete(Foglia f) {
- Elimina(f, Root);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement