suche implementiert
This commit is contained in:
12
Knoten.java
12
Knoten.java
@@ -30,6 +30,18 @@ public class Knoten extends Baumelement
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Datenelement Suche(String suche){
|
||||
if (this.daten.gibSchlüssel() == suche) {
|
||||
return daten;
|
||||
} else {
|
||||
if (this.daten.gibSchlüssel().compareTo(suche)>0) {
|
||||
return this.linkerNachfolger.Suche(suche);
|
||||
} else {
|
||||
return this.rechterNachfolger.Suche(suche);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user