Re: Determining the height of a non-binary tree
| Newsgroups | gmane.comp.ai.weka |
|---|---|
| Message-ID | <162460305587.32859.5134809174184340276@sys-mailman-prd.its.waikato.ac.nz> |
Dear Professor Eibe Frank,
I have changed my code with the following one:
int getHeight(ClassifierTree data){
int height=0;
if (data==null){
return 0;
}
for (int i=0; i<data.m_sons.length; i++) {
height = Math.max(height, getHeight(data.m_sons[i]));
}
return height + 1;
}
but I don't know with which argument to call the function
in order to supply to it the ClassifierTree. I tried
height = getHeight(new ClassifierTree(m_toSelectModel));
but this gives me a NullPointerException!
Could you please help?
Thank you in advance,
Spyros Halkidis
_______________________________________________
Wekalist mailing list -- [email protected]
Send posts to [email protected]
To unsubscribe send an email to [email protected]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html