Print tree size

This commit is contained in:
Manuel Thalmann 2022-10-31 20:20:13 +01:00
parent 2d1e65730c
commit 24225d7595

View file

@ -32,6 +32,7 @@ public class RankingTreeServer implements CommandExecutor {
public String execute(String rankingList) {
Tree<Competitor> competitorTree = createTree(rankingList);
return "Rangliste (Tree)\n" + createSortedText(competitorTree);
return "Rangliste (Tree)\n" + createSortedText(competitorTree) + "\n\n" +
"Height: " + competitorTree.height() + "\nSize: " + competitorTree.size();
}
}