public void insert(Buchstabe pBuchstabe,char[] pChar,int pStelle)
{
if(pBuchstabe==null)
return;
int Stelle = pStelle;
if(baum.isEmpty())
{
baum=new BinaryTree(pBuchstabe);
}
else {
if(pStelle < pChar.length)
{
if(pChar[Stelle] == '.')
{
Mybaum lTree=this.getLeftTree();
Stelle++;
lTree.insert(pBuchstabe,pChar,Stelle);
this.baum.setLeftTree(lTree.baum);
}
else
if(pChar[Stelle]=='-')
{
Mybaum rTree=this.getRightTree();
Stelle++;
rTree.insert(pBuchstabe,pChar,Stelle);
this.baum.setLeftTree(rTree.baum);
}
}
else
return;
}
}
So this is my insert Method. The Problem is that it only adds the last Buchstabe which i pass to it to the BinaryTree. So it will get a Buchstabe, a char Array with some '.' or '-' code in it and a integer which starts at 0 when the insert merhod is called at the beginning. There is no real error but i get this output : http://puu.sh/h9I4E/beee4f30a9.png . It should create a Binary Tree with 26 Items but only one is showing up on the wrong side.